Skip to content

Series.mode has not a sort argument. #16053

Closed
@arnau126

Description

@arnau126

Code Sample

import pandas as pd

s = pd.Series(['b', 'c', 'a', 'c', 'a', 'b', 'a'])
s.mode(sort=False)

traceback:

<ipython-input-4-a5ccd47afe9c> in <module>()
      1 s = pd.Series(['b', 'c', 'a', 'c', 'a', 'b', 'a'])
----> 2 s.mode(sort=False)

TypeError: mode() got an unexpected keyword argument 'sort'

Problem description

Pandas DOC for Series.mode says that this function has a sort argument.
http://pandas.pydata.org/pandas-docs/stable/generated/pandas.Series.mode.html

But looking at source code, I see that it is not true:
https://github.com/pandas-dev/pandas/blob/v0.19.2/pandas/core/series.py#L1220-L1237

Output of pd.show_versions()

INSTALLED VERSIONS ------------------ commit: None python: 2.7.12.final.0 python-bits: 64 OS: Linux OS-release: 4.8.0-46-generic machine: x86_64 processor: x86_64 byteorder: little LC_ALL: None LANG: ca_ES.UTF-8 LOCALE: None.None

pandas: 0.19.2
nose: 1.3.7
pip: 9.0.1
setuptools: 35.0.0
Cython: 0.25.2
numpy: 1.12.0
scipy: 0.18.1
statsmodels: 0.6.1
xarray: None
IPython: 5.3.0
sphinx: None
patsy: 0.4.1
dateutil: 2.6.0
pytz: 2016.7
blosc: None
bottleneck: None
tables: None
numexpr: None
matplotlib: 1.5.1
openpyxl: 2.4.1
xlrd: 1.0.0
xlwt: None
xlsxwriter: 0.7.3
lxml: None
bs4: None
html5lib: 0.999999999
httplib2: None
apiclient: None
sqlalchemy: 1.0.14
pymysql: 0.7.5.None
psycopg2: 2.7.1 (dt dec pq3 ext lo64)
jinja2: 2.9.6
boto: None
pandas_datareader: None

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