Ask Question
9 August, 07:53

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

+2
Answers (1)
  1. 9 August, 09:37
    0
    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
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “Write a python function c that converts bitstring array back to an integer numpy array ...” in 📙 Computers & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers