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
Can someone join my pad let? If so here it is https://pad let.com/skeefex21/fyhcso9xasndl4xh
mario62 [17]

Answer:

Sure

Explanation:

5 0
3 years ago
I'm showing my friends brainly. Answer with anything so they can see how fast I can get answers.
katrin [286]

Answer:

really fast

Explanation:

Hi everyone

8 0
3 years ago
Read 2 more answers
Office 365 ProPlus can be deployed to your enterprise. When doing so, which tool enables you to choose the language, hardware ar
lara [203]

Answer:

Office Deployment Tool (ODT)

Explanation:

The Office 365 ProPlus can be deployed using the Office Deployment Tool,  which is tool based pf the command line tool with which Office applications can be downloaded and installed

From the office deployment tool, the language, the computer hardware architecture that is to be used, the version of office to be installed, and the method of deployment of software can be selected

5 0
3 years ago
On an ssd, a dashed arrow usually represents what?​
levacccp [35]
SSD stands for system sequence diagrams. SSd diagrams <span>model the interactions between objects in a single use case and illustrate how the different parts of a </span>system<span> interact with each other </span>
On an SSD, a dashed arrow usually represents an object. SSD <span>depicts the </span>objects<span> and classes involved in the scenario and the </span>sequence<span> of messages exchanged between the </span><span>objects.</span>
4 0
3 years ago
Write a class named Car that has the following member variables: - yearModel. An int that holds the car’s year model. - make. A
Wewaii [24]

Answer:

public class Car {

//Member variables    

private int yearModel;

   private String make;

   private int speed;

   //Constructor

   public Car(int yearModel, String make, int speed) {

       this.yearModel = yearModel;

       this.make = make;

       this.speed = speed;

   }

   //Accessor Methods getters and setters

   public int getYearModel() {

       return yearModel;

   }

   public void setYearModel(int yearModel) {

       this.yearModel = yearModel;

   }

   public String getMake() {

       return make;

   }

   public void setMake(String make) {

       this.make = make;

   }

   public int getSpeed() {

       return speed;

   }

   public void setSpeed(int speed) {

       this.speed = speed;

   }

   //Accelerate function

   public void accelerate(){

       this.speed+=5;

   }

   // Brake function

   public void brake(){

       this.speed-=5;

   }

}

Explanation:

  • As required by the question, The class Car is created using Java programming language
  • The members variables, the constructor, The accessor methods are all created as required by the question (Please pay attention to the comments added to the code)
  • The accelerate and brake functions that add and subtract 5 from the speed member variable respectively are also created.
6 0
3 years ago
Other questions:
  • Which action best describes a branch in a computer program
    15·1 answer
  • What is statement used to communicate ones feelings in a nonconfrontational manner
    9·1 answer
  • I don’t understand how to make a hyperlink or put an image in an html file
    13·1 answer
  • You will be given a value of n and k, one line each. You will write a program that determines the minimum number of probe attemp
    9·1 answer
  • If you are inserting an address block with the Address Block dialog box and the fields do not connect automatically, what can yo
    6·2 answers
  • What is the most significant issue that needs to be addressed when ensuring the proper functioning of a computer?
    7·1 answer
  • A celebrity blogger you have followed for years advises readers to try a new beauty product. Before purchasing the product, a sa
    10·1 answer
  • What allows customers to use the Web to find answers to their questions or solutions to their problems?
    5·2 answers
  • Which keyboard shortcut pastes information from the clipboard?
    6·2 answers
  • Does speedtest report megabytes per second or megabits
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!