Skip to content

Series.sort_values doesn't support a by keyword argument, but the documentation claims it does #11540

Closed
@mineo

Description

@mineo

pandas: 0.17.0

import pandas
s = pandas.Series([1,2,3])
s.sort_values(by=["a"])

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-4-4a7ccaa074a5> in <module>()
      1 import pandas
      2 s = pandas.Series([1,2,3])
----> 3 s.sort_values(by=["a"])

TypeError: sort_values() got an unexpected keyword argument 'by'

https://github.com/pydata/pandas/blob/1135ce34fc2fb995e239a7d36aee1b687ef69dd9/pandas/core/series.py#L1609 does indeed not support by, but the docs list it as a supported keyword argument.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions