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
Closed

nanops on datetime objects failing #487

creeson opened this issue Dec 14, 2011 · 1 comment
Labels
Milestone

Comments

@creeson
Copy link

creeson 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
Copy link
Member

wesm 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 as completed Dec 15, 2011
dan-nadler pushed a commit to dan-nadler/pandas that referenced this issue Sep 23, 2019
Make retry logic more robust to failures for version store write/append
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants