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
When you see an ad on social media that relates to your profile or something
sesenic [268]

Answer:

Tritium BF

Explanation:

5 0
2 years ago
Read 2 more answers
Give brainliest if you tell me the can tell me the most random thing
Scorpion4ik [409]

Mood

Explanation:

Because it gets changed by the time you are happy or sad. Same that while you are reading if you like your. mood gets good but if you dont find this ans satisfied your mood gets changed.

3 0
3 years ago
Please write a complete program to calculate monthly payment given
jasenka [17]

Explanation:

Code with comments:

#include <stdio.h>

#include <math.h>  

/* math library is required to use pow() function

First we need to create a function to calculate the Monthly Payment

It would take three inputs Rate, Years, and Principle amount

Then we converted the Rate and Months according to problem statement

pow() function is used to find (1+R)^M

Then finaly this function returns the value of Monthly Payment  */

float MonthlyPay(float R, int M, int P)

{

    R=R/1200;

    M=M*12;

   float po=pow((1+R),M);

   float PayM=(R+(R/(po-1)))*P;

    return PayM;

}

/*  In the main() function we get 3 inputs from the user Years, Rate and Principle amount

then we call the MonthlyPay function and pass it 3 inputs that we got from the user

then we calculated the total Payment by multiplying the Monthly Pay and total number of months

then we calculated the interest Amount by subtracting the Principle Amount from total Pay

Testing is performed and output result is given at the end and also attached in the image   */

int main(void)

{

    float Rate;

    int Year, Amount;

    printf("Enter Years: ");

    scanf("%d",&Year);

    printf("Enter Rate: ");

    scanf("%f",&Rate);

    printf("Enter Principle Amount: ");

    scanf("%d",&Amount);

   

    float Pay = MonthlyPay(Rate, Year, Amount);

    printf ("Monthly Payment is: %f \n", Pay);

    float totalPay=Pay*Year*12;

    printf ("Total Payment is: %f \n", totalPay);

    float interest=totalPay-Amount;

    printf ("Interest Expense is: %f \n", interest);

    return 0;

}

Output:

Enter Years: 5

Enter Rate: 7

Enter Principle Amount: 12200

Monthly Payment is: 241.572767

Total Payment is: 14494.367188

Interest Expense is: 2294.367188

7 0
3 years ago
What kind of material is used for DRAM (dynamic random-access memory)?
Alex Ar [27]

The kind of material that is used for DRAM (dynamic random-access memory) is metal-oxide-semiconductor.

<h3>What is DRAM?</h3>

DRAM was invented in 1968. It is a type of RAM used in modern computers and laptops. It is a type of random access memory. Its name is dynamic random access memory.

Metal-oxide-semiconductor is used in making the transistors and capacitors of the DRAM, which are used to store the data. They hold a bit of the data in these capacitors and transistors.

Thus, the material that is used is metal-oxide-semiconductor to make DRAM (dynamic random-access memory).

To learn more about DRAM, refer to the link:

brainly.com/question/20216206

#SPJ1

3 0
1 year ago
Differentiate between childhood socialization and adulthood socialization ​
AveGali [126]

Answer:

In adolescence, socialization is concerned with the development of overarching values and the self-image. In adulthood, socialization involves more overt and specific norms and behaviors, such as those related to the work role as well as more superficial personality features.

6 0
3 years ago
Other questions:
  • It proceeds the statement causes execution of the current loop iteration to end and commence at the beginning of the next loop.
    10·1 answer
  • Write a program to calculate and return total surface area of a box using FUNCTION _END FUNCTION.​
    15·1 answer
  • What is the difference between a key escrow and a recovery agent? (Choose all that apply.)
    12·1 answer
  • Write a program that declares a constant named QUARTS_IN_GALLON which holds the number of quarts in a gallon (4). Also declare a
    8·1 answer
  • What is the process viewing files in chrome web browser cache?
    6·1 answer
  • A(n) ____ is a grouping of related objects within a domain,
    15·1 answer
  • Choose the answer. Janice's IT department found that her computer had a program on it that was collecting her personal informati
    5·1 answer
  • Name the character encoding standard that enables up to 128 different commonly used characters,
    8·1 answer
  • What is a computer class from 8​
    12·1 answer
  • System development life cycle
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!