Skip to content

Sort MultiIndex to improve performance#124

Open
cinabars wants to merge 2 commits into
cheind:developfrom
cinabars:develop
Open

Sort MultiIndex to improve performance#124
cinabars wants to merge 2 commits into
cheind:developfrom
cinabars:develop

Conversation

@cinabars

Copy link
Copy Markdown
Contributor

Sorting a MultiIndex dataframe improves performance. In some cases, indexing a MultiIndex dataframe without sorting can even throw an UnsortedIndexError, so this change prevents that from occuring. (source: https://pandas.pydata.org/pandas-docs/stable/user_guide/advanced.html#sorting-a-multiindex)

@cheind

cheind commented Sep 12, 2020

Copy link
Copy Markdown
Owner

Hey thanks for the PR!

Couple of comments:

  • Calling sort_index in new_event_dataframe is not doing anything as the dataframe is empty.
  • Did you see any performance improvements?
  • Did the error you mentioned actually occur?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants