Re: [Numpy-discussion] why does binary_repr don't support arrays

2009-10-22 Thread Ralf Gommers
On Tue, Oct 20, 2009 at 11:17 AM, wrote: > > Hello, > > I'm always wondering why binary_repr doesn't allow arrays as input values. > I always have to use a work around like: > > import numpy as np > > def binary_repr(arr, width=None): > binary_list = map((lambda foo: np.binary_repr(foo, width

[Numpy-discussion] why does binary_repr don't support arrays

2009-10-20 Thread markus . proeller
Hello, I'm always wondering why binary_repr doesn't allow arrays as input values. I always have to use a work around like: import numpy as np def binary_repr(arr, width=None): binary_list = map((lambda foo: np.binary_repr(foo, width)), arr.flatten()) str_len_max = len(np.binary_repr(ar