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
Being aware of and understanding why potential buyers on a web site do not complete their purchases requires the expertise of __
TiliK225 [7]
<span>a web analyst and usability expert</span>
8 0
3 years ago
Read 2 more answers
Write a c program that asks the user to enter two numbers. the program should use the conditional operator to determine which nu
iris [78.8K]

Using the knowledge in computational language in C++ it is possible to write a code that asks the user to enter two numbers. the program should use the conditional operator to determine which number is the smaller and which is the larger.

<h3>Writting in C++ code:</h3>

#include <iostream>

using namespace std;

int main(){

float a, b;

cout<<"Enter two numbers:";

cin>>a>>b;

if(a>b) {

cout<<"Larger Number:"<<a<<endl;;

cout<<"Smaller Number:"<<b;

}

else if(b<a){

cout<<"Larger Number:"<<b<<endl;

cout<<"Smaller Number:"<<a;

}else{

cout<<"Number are equal!"<<endl;

}

}

See more about C++ code at brainly.com/question/19705654

#SPJ1

6 0
2 years ago
With the _______ network topology, reliability is the major advantage while high cost is the disadvantage.
WINSTONCH [101]
<span>With the mesh network topology, reliability is the major advantage while high cost is the disadvantage.
Because of its reliability advantage mesh topology is used in backbone networks, because of the redundancy the failure of one node in the network does not result in failure of the entire network. However lot of cabling is required and the cost and maintenance requirements are high. 

</span>
7 0
3 years ago
In Shoreville, the last low tide was at 12:00 a.m. About what time will the next high tide occur?
Oliga [24]
6 pm they happen every 12 hours

4 0
3 years ago
Read 2 more answers
The cardinality of the friend_of relationship set between two student entities in the student entity set should be:
Afina-wow [57]

Answer:

One to One Relationship

Explanation:

Given that in a computer systems analysis about an entity-relationship model, a one-to-one relationship is a form of cardinality that involves the relationship that exists between two different entities Y and Z, such that one element Y can only be associated with one element Z, or in the other way round.

Hence, the cardinality of the friend_of relationship set between two student entities in the student entity set should be: "One to One Relationship"

3 0
3 years ago
Other questions:
  • Every preprocessing directive must begin with:
    11·1 answer
  • HURRY! The steps for printing mailing labels are available after you click which icon?
    15·1 answer
  • In the context of web and network privacy, an acceptable use policy is _____.
    15·1 answer
  • Use the variables k and total to write a while loop that computes the sum of the squares of the first 50 counting numbers, and a
    10·1 answer
  • . char values are surrounded by _____ quotes
    15·1 answer
  • Which of the following is a preferable method to secure wireless access in a SOHO?
    12·1 answer
  • Desirable workplace habits and skills include:
    14·1 answer
  • These are horizontal blocks of cells running across the entire width of the spreadsheet.
    11·1 answer
  • I need a 75 word Radio Ad on Why Technology should be kept in a schools budget.
    11·1 answer
  • What is a thread? what resources does it share with other threads in the same process?
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!