Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #70690

Re:Convert numpy array to single number

From Dave Angel <davea@davea.name>
Subject Re:Convert numpy array to single number
Date 2014-04-28 15:19 -0400
Organization news.gmane.org
References <088cdf75-f196-404b-ba77-567559f431d8@googlegroups.com>
Newsgroups comp.lang.python
Message-ID <mailman.9554.1398712391.18130.python-list@python.org> (permalink)

Show all headers | View raw


mboyd02255@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

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Convert numpy array to single number mboyd02255@gmail.com - 2014-04-28 06:04 -0700
  Re: Convert numpy array to single number Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-04-28 14:16 +0000
  Re:Convert numpy array to single number Dave Angel <davea@davea.name> - 2014-04-28 15:19 -0400
  Re: Convert numpy array to single number Tom P <werotizy@freent.dd> - 2014-04-29 17:42 +0200
    Re: Convert numpy array to single number Papp Győző <pappgyozo@gmail.com> - 2014-05-01 15:26 +0200

csiph-web