Skip to content

Series.quantile() should convert input dtype to float #6555

Closed
@nspies

Description

@nspies

Would love it if Series.quantile() converted the dtype to float (as DataFrame.quantile() appears to do). As it is, I get the following error with dtype=object:

In [8]: low
Out[8]: 
...
Name: p, Length: 2218, dtype: object

In [9]: low.quantile(0.33)
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
/ase/src/ase/analysis/conservation.py in <module>()
----> 1 low.quantile(0.33)

/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pandas/core/series.pyc in quantile(self, q)
   1323             return pa.NA
   1324         result = _quantile(valid_values, q * 100)
-> 1325         if result.dtype == _TD_DTYPE:
   1326             from pandas.tseries.timedeltas import to_timedelta
   1327             return to_timedelta(result)

AttributeError: 'float' object has no attribute 'dtype'

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugDtype ConversionsUnexpected or buggy dtype conversionsNumeric OperationsArithmetic, Comparison, and Logical operations

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions