Skip to content

BUG: Nested sort with NaN #3917

Closed
Closed
@hayd

Description

@hayd

Nested sort doesn't seem to work with NaNs, see this SO question.

In [11]: df
Out[11]:
    a   b
0   1   9
1   2 NaN
2 NaN   5
3   1   2
4   6   5
5   8   4
6   4   5

In [12]: df.sort(columns=["a","b"])
Out[12]:
    a   b
3   1   2
0   1   9
1   2 NaN
2 NaN   5
6   4   5
4   6   5
5   8   4

(It works as expected using a single columns)

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugNumeric OperationsArithmetic, Comparison, and Logical operations

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions