Sorry for the slow reply. I returned last night from spring vacation.
Thanks for the report. I did not realize that bottleneck 0.4.3
required python 2.6.
I use the `with` statement to quiet the warnings that recent versions
of numpy make when unit testing binary operations with NaNs.
Python 2.5 does have a `with` statement, but I would need to add:
from __future__ import with_statement
As a workaround you could add that to the benchmark and a few unit test modules.
I added your report to the bottleneck issue tracker:
https://github.com/kwgoodman/bottleneck/issues/14
I added
from __future__ import with_statement
to the attached bottleneck. If someone could test it with python 2.5
(I don't have python 2.5) then I'll commit if it works.
I can be reached on my cell 917-971-6387
> <Bottleneck-0.5.0dev_32bitOS.tar.gz>
> <Bottleneck-0.5.0dev_64bitOS.tar.gz>
raise AssertionError("\nItems are not equal:\n\nfunc nanargmin | input a4 (int32) | shape (2, 0) | axis -2\n\nInput array:\n[]\n\n dtype mismatch int32 int64\n ACTUAL: dtype('int32')\n DESIRED: dtype('int64')")
raise AssertionError("\nItems are not equal:\n\nfunc nanargmax | input a4 (int32) | shape (2, 0) | axis -2\n\nInput array:\n[]\n\n dtype mismatch int32 int64\n ACTUAL: dtype('int32')\n DESIRED: dtype('int64')")
raise AssertionError("\nArrays are not equal\n\nfunc rankdata | input a0 (int32) | shape (0,) | axis -1\n\nInput array:\n[]\n\n(mismatch 100.0%)\n x: array('Crashed', \n dtype='|S7')\n y: array([], dtype=float64)")
raise AssertionError("\nArrays are not equal\n\nfunc nanrankdata | input a0 (int32) | shape (0,) | axis -1\n\nInput array:\n[]\n\n(mismatch 100.0%)\n x: array('Crashed', \n dtype='|S7')\n y: array([], dtype=float64)")
<Bottleneck-0.5.0dev_32bitOS.tar.gz>
<Bottleneck-0.5.0dev_64bitOS.tar.gz>
Hmm...Are you using 32 or 64 bit linux? Did you use the corresponding
source distribution?
import numpy as np
import bottleneck as bn
a = np.ones((2,0), dtype=np.int32)
a.dtype
np.argmin(a, axis=-2).dtype
bn.slow.nanargmin(a, axis=-2).dtype
bn.nanargmin(a, axis=-2).dtype
import numpy as np
import bottleneck as bn
a = np.ones((2,0), dtype=np.int32)
a.dtype
dtype('int64')np.argmin(a, axis=-2).dtype
dtype('int64')bn.slow.nanargmin(a, axis=-2).dtype
dtype('int32')bn.nanargmin(a, axis=-2).dtype
Since you are using a 32 bit OS I expect that numpy should return 32
bit ints for:
np.argmin(a, axis=-2).dtype
when a is 32 bit ints.
Upgrading numpy should take care of the first two unit test failures
and maybe even the last two.
I think maybe il give a shot one of these days to using the other libs
On a side note
One reason I liked your library is o try as a substitute for some of wes's functions in pandas - eg for some basic stat operations with Series
Have u done any tests vs pandas in this regards?
I can be reached on my cell 917-971-6387
Just a guess. Might not solve anything.
> When I first installed numpy i wanted to use 64 but version but had some issues installing other (non numpy) libs on windows (as I run on both systems)
> And decided on all 32 bit to make life easier
So your linux system is definitely 32 bit?
Here's my system (x86_64):
$ uname -a
Linux kg 2.6.35-28-generic #49-Ubuntu SMP Tue Mar 1 14:39:03 UTC 2011
x86_64 GNU/Linux
> I think maybe il give a shot one of these days to using the other libs
I don't use windows, but this may be of interest for anyone thinking
about using 64 bit windows:
http://www.lfd.uci.edu/~gohlke/pythonlibs/
http://wiki.cython.org/64BitCythonExtensionsOnWindows
> On a side note
> One reason I liked your library is o try as a substitute for some of wes's functions in pandas - eg for some basic stat operations with Series
>
> Have u done any tests vs pandas in this regards?
I have a package that is similar to pandas. It is called la (for
labeled array). The latest development version (0.5dev) already uses
bottleneck.
doc: http://berkeleyanalytics.com/la
code: https://github.com/kwgoodman/la
mailing list: http://groups.google.com/group/labeled-array
> So your linux system is definitely 32 bit?
>
> Here's my system (x86_64):
>
> $ uname -a
> Linux kg 2.6.35-28-generic #49-Ubuntu SMP Tue Mar 1 14:39:03 UTC 2011
> x86_64 GNU/Linux
Here's a check for the default int that numpy uses on your system:
>> np.arange(5).dtype
dtype('int64')