1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
arlik [135]
3 years ago
5

Write a python function c that converts bitstring array back to an integer numpy array

Computers and Technology
1 answer:
tresset_1 [31]3 years ago
6 0

Answer:

import numpy as np#importing numpy module with an alias np.

def c(bitstring_array):# defining function c.

   num_integer=bitstring_array.dot(2**np.arange(bitstring_array.size)[::-1])#bitstring conversion.

   return num_integer#returning integer array.

print("Enter bits")

Bit_l=input().split(" ")#enter space separated bitstring.

for i in range(len(Bit_l)):#iterating over the bitstring.

   Bit_l[i]=int(Bit_l[i])

bitstring_array=np.array(Bit_l)

print(c(bitstring_array))#function call.

Output:

Enter bits

1 1 1 0 0 1

57

You might be interested in
Each peripheral device has its own software, called a(n) ____, which contains the detailed instructions required to start that d
olga nikolaevna [1]
OS or operating system
4 0
3 years ago
What is an Algorithm? (might not be in the chapter text). Give an example.
Rashid [163]

Answer:

The answer to this question is given below in the explanation section.

Explanation:

An algorithm is the list of a finite set of instructions and rules that a computer needs to do to complete a task in order to solve a problem.

In short, an algorithm is a series of instructions that are implemented step by step to solve a problem. For example, you could consider a pizza recipe an algorithm for making a pizza in an everyday life routine. But when you are talking about using algorithms in computation and in mathematics. It means that solving a problem using a series of steps step by step.

For example, your everyday tasks aligned on a google calendar and remind you about your tasks using the alarm, etc- how to implement this using set of instructions and rules- is an algorithm.

Solving a quadratic equation is another example of an algorithm.

Binary search, array sorting are an example of an algorithm in computation. Because these algorithms based on the execution of step-by-step instruction to solve a problem such as sorting a list of numbers etc.  

6 0
3 years ago
The move toward access instead of ownership is a sign of collaborative consumption.
Nina [5.8K]

Answer:

the answer is true

Explanation:

8 0
3 years ago
MARK AS BRANLIEST!!!!
Oxana [17]

1. The reason for a photograph being a favorite is the creativity to capture nature in one single frame.

2. Photographs present the aesthetics and ability to view the world from a new perspective. Photographs' main benefit is they associate with the good memories the last for a lifetime

5 0
2 years ago
Read 2 more answers
Who was the creator of the game Fnaf?
Lisa [10]
"Scott Cawthon" did that.........
8 0
3 years ago
Read 2 more answers
Other questions:
  • Sharing a workbook helps to complete ________ (A, tasks) (B,changes) (C, typing) on time. Multiple people acssessing the workboo
    9·1 answer
  • Based on the passage​ and/or drawing on your prior​ knowledge, you realize that an HMO is​ what?
    9·1 answer
  • An is auditor reviewing a network log discovers that an employee ran elevated commands on his/her pc by invoking the task schedu
    10·1 answer
  • James, a technician, needs to format a new drive on a workstation. He will need to configure read attributes to specific local f
    5·1 answer
  • Give an O(log m + log n)-time algorithm that takes two sorted lists of sizes m and n, respectively, as input and returns the ith
    7·1 answer
  • A laptop can be kept on palm to work. [true/false) ​
    5·1 answer
  • What is a computer please tell me ​
    10·2 answers
  • TCP and the User Datagram Protocol (UDP) provide _________ between processes on any two of those hosts. A. address translation B
    6·1 answer
  • This provides an easy method for workers to use their computers. FAT FAT RAM RAM DOS DOS GUI
    12·1 answer
  • Name 3 things that you use daily that are considered computers?
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!