Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nanops on datetime objects failing #487

Closed
creeson opened this issue Dec 14, 2011 · 1 comment

Comments

@creeson
Copy link

commented Dec 14, 2011

Hi,

It looks like apply_along_axis does not play well with objects that have no length? If I go comment out the numpy 1.6.1 workaround in Python 3.x portion, this goes back to working fine.

Thanks!

For example:

import pandas as ps
x = ps.Series([ps.datetime(2011,4,3)])
x.min()

Traceback (most recent call last):
File "<pyshell#3>", line 1, in
x.min()
File "C:\Python27\lib\site-packages\pandas\core\series.py", line 722, in min
return nanops.nanmin(self.values, skipna=skipna, copy=True)
File "C:\Python27\lib\site-packages\pandas\core\nanops.py", line 118, in nanmin
result = np.apply_along_axis(builtin.min, apply_ax, values)
File "C:\Python27\lib\site-packages\numpy\lib\shape_base.py", line 104, in apply_along_axis
outshape[axis] = len(res)
TypeError: object of type 'datetime.datetime' has no len()

@wesm

This comment has been minimized.

Copy link
Member

commented Dec 15, 2011

OK, this is fixed in master. Probably fails in Python 3 now but, so it goes-- will report the bug upstream to NumPy

@wesm wesm closed this Dec 15, 2011

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.