Skip to content

dtype mismatch when calling .median() #26

Closed
@mpenning

Description

@mpenning

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions