Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sort MultiIndex to improve performance #124

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

cinabars
Copy link
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
Copy link
Owner

cheind commented Sep 12, 2020

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