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

dtype mismatch when calling .median() #26

Closed
mpenning opened this issue Jan 3, 2011 · 1 comment
Closed

dtype mismatch when calling .median() #26

mpenning opened this issue Jan 3, 2011 · 1 comment

Comments

@mpenning
Copy link

mpenning commented Jan 3, 2011

Using python 2.5.2, pandas 0.3 and numpy 1.5.1 on a debian lenny box... mean() works, but not median()

>>> df1['b'].truncate(before=dt.date(2010,12,2),after=dt.date(2010,12,4))
2010-12-02    6
2010-12-03    7
2010-12-04    8
>>> df1['b'].truncate(before=dt.date(2010,12,2),after=dt.date(2010,12,4)).median()
Traceback (most recent call last):
 File "<stdin>", line 1, in <module>
 File "build/bdist.linux-i686/egg/pandas/core/series.py", line 486, in median
 File "moments.pyx", line 70, in tseries.median (pandas/lib/src/tseries.c:5967)
 File "moments.pyx", line 28, in tseries.kth_smallest (pandas/lib/src/tseries.c:5539)
ValueError: Buffer dtype mismatch, expected 'double_t' but got 'long'
>>> df1['b'].truncate(before=dt.date(2010,12,2),after=dt.date(2010,12,4)).mean()
7.0
@wesm
Copy link
Member

wesm commented Jan 3, 2011

Fixed this today-- git HEAD should work fine

dan-nadler pushed a commit to dan-nadler/pandas that referenced this issue Sep 23, 2019
…must-read-from-master

Delete assertion must read from master
stijnvanhoey pushed a commit to stijnvanhoey/pandas that referenced this issue Dec 23, 2019
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants