Convert numpy array to single number

Dave Angel davea at davea.name
Mon Apr 28 15:19:13 EDT 2014


mboyd02255 at gmail.com Wrote in message:
> I have a numpy array consisting of 1s and zeros for representing binary numbers:
> 
> e.g.
> 
>      >>> binary
>      array([ 1.,  0.,  1.,  0.])
> 
> I wish the array to be in the form 1010, so it can be manipulated.
> 
> I do not want to use built in binary converters as I am trying to build my own.
> 

One thousand and ten is an int, not an array. 

So is 10, but it seems a more likely value you might be trying for.

As for using the builtin binary converters, you'd better be a lot
 more specific,  as you cannot even print an int in decimal form
 without utilizing them. The number is in binary already.
 

Please copy the exact problem and constraints,  as well as what
 you've written so far and what's wrong with it.

-- 
DaveA




More information about the Python-list mailing list