On Sat, Feb 27, 2010 at 12:03 PM, Ivo Maljevic
<ivo.maljevic@gmail.com> wrote:
Another suggestion, and this one also makes the parallel to Matlab. Make sure it works for vectors:
>>> a=np.array([7,11,250])
>>> nextpow2(a)
array([ 3., 4., 8.])
In [27]: tab.searchsorted([7,11,250])
Out[27]: array([3, 4, 8])
In [28]: np.frexp([7,11,250])[1]
Out[28]: array([3, 4, 8], dtype=int32)
<snip>
Chuck