Convert numpy array to single number

Steven D'Aprano steve+comp.lang.python at pearwood.info
Mon Apr 28 10:16:08 EDT 2014


On Mon, 28 Apr 2014 06:04:02 -0700, mboyd02255 wrote:

> 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.

Did you have a question, or are you just sharing?



-- 
Steven D'Aprano
http://import-that.dreamwidth.org/



More information about the Python-list mailing list