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

BUG: Series.quantile dtype / nan handling issue #12772

Closed
sinhrks opened this issue Apr 2, 2016 · 0 comments
Closed

BUG: Series.quantile dtype / nan handling issue #12772

sinhrks opened this issue Apr 2, 2016 · 0 comments
Labels
Bug Numeric Operations Arithmetic, Comparison, and Logical operations
Milestone

Comments

@sinhrks
Copy link
Member

sinhrks commented Apr 2, 2016

Found some issues when working on #12572. Both being fixed.

Code Sample, a copy-pastable example if possible

1. DataFrame may coerce to float even if interpolation
# OK, same as numpy
pd.Series([1, 2, 3]).quantile([0.5], interpolation='lower').dtypes
# dtype('int64')

# NG, it must be int
pd.DataFrame({'A': [1, 2, 3]}).quantile([0.5], interpolation='lower').dtypes
# A    float64
# dtype: object
2. May return scalar even if its input is a list-like
# NG, it must be a Series
pd.Series([]).quantile([0.2, 0.3])
# nan

output of pd.show_versions()

Current master.

@sinhrks sinhrks added Bug Numeric Operations Arithmetic, Comparison, and Logical operations labels Apr 2, 2016
@sinhrks sinhrks added this to the 0.18.1 milestone Apr 2, 2016
jreback pushed a commit to jreback/pandas that referenced this issue Apr 3, 2016
CLN: clean up quantile & move to BlockManager

closes pandas-dev#12741
closes pandas-dev#12772
closes pandas-dev#12469
closes pandas-dev#12752
@jreback jreback closed this as completed in 36a8bd9 Apr 3, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Numeric Operations Arithmetic, Comparison, and Logical operations
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant