Skip to content

Problem sorting strings with numbering indexes #535

@hugoalgarvio

Description

@hugoalgarvio

Version Checks (indicate both or one)

  • I have confirmed this bug exists on the lastest release of Linopy.

  • I have confirmed this bug exists on the current master branch of Linopy.

Issue Description

String A_ID, being ID decimal, will sort A_100 first than A_20

Reproducible Example

Data=["A_2","A_20","A_100","A_1000"]
print(Data.sort_index())

Expected Behavior

"A_100", "A_1000", "A_2","A_20"

Installed Versions

Details Replace this line.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions