-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Mode should be defined if the Series consist of only one object #15714
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
Milestone
Comments
Thanks. Mind sending a PR with a fix?
FYI, pandas' mode isn't necessarily an aggregation, since it doesn't do any tie breaking. |
3 tasks
jreback
pushed a commit
that referenced
this issue
Mar 29, 2017
Author: Robin <[email protected]> This patch had conflicts when merged, resolved by Committer: Jeff Reback <[email protected]> Closes #15744 from buyology/issue-15714-fix-mode and squashes the following commits: 8c08cd5 [Robin] Added multi-test and whatsnew note 5f36395 [Robin] Fixed flake issues, removed duplicate test, inserted GH issue number reference 5f829e1 [Robin] Merge conflict 0e2dec0 [Robin] Fixed tests 26db131 [Robin] Return mode even if single value (#15714) 44dbbb2 [Robin] Return mode even if single value (#15714)
mattip
pushed a commit
to mattip/pandas
that referenced
this issue
Apr 3, 2017
Author: Robin <[email protected]> This patch had conflicts when merged, resolved by Committer: Jeff Reback <[email protected]> Closes pandas-dev#15744 from buyology/issue-15714-fix-mode and squashes the following commits: 8c08cd5 [Robin] Added multi-test and whatsnew note 5f36395 [Robin] Fixed flake issues, removed duplicate test, inserted GH issue number reference 5f829e1 [Robin] Merge conflict 0e2dec0 [Robin] Fixed tests 26db131 [Robin] Return mode even if single value (pandas-dev#15714) 44dbbb2 [Robin] Return mode even if single value (pandas-dev#15714)
closed by #15744 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Code Sample
Problem description
Currently the
mode
of a series is not defined if the series consist of only one object. This limits the use of the mode as an aggregation method.Compare this with the behaviour of other libraries, e.g.
scipy
:Expected Output
Output of
pd.show_versions()
pandas: 0.19.2
nose: 1.3.7
pip: 9.0.1
setuptools: 34.3.1
Cython: None
numpy: 1.8.0rc1
scipy: 0.13.0b1
statsmodels: None
xarray: None
IPython: 5.1.0
sphinx: 1.4.8
patsy: None
dateutil: 2.6.0
pytz: 2016.10
blosc: None
bottleneck: None
tables: None
numexpr: None
matplotlib: 1.3.1
openpyxl: 2.3.0-b1
xlrd: 1.0.0
xlwt: None
xlsxwriter: 0.9.3
lxml: 3.7.3
bs4: None
html5lib: None
httplib2: None
apiclient: None
sqlalchemy: 1.1.6
pymysql: None
psycopg2: 2.6.2 (dt dec pq3 ext lo64)
jinja2: 2.9.5
boto: 2.42.0
pandas_datareader: None
The text was updated successfully, but these errors were encountered: