Skip to content

PERF: assert_index_equal with MultiIndex #51544

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

Merged
merged 2 commits into from
Feb 22, 2023

Conversation

jbrockmendel
Copy link
Member

test_indexer_caching takes 10.09s on main, 2.92 with this branch.

@phofl phofl added this to the 2.1 milestone Feb 22, 2023
@phofl phofl added Testing pandas testing functions or related to the test suite Performance Memory or execution speed performance MultiIndex labels Feb 22, 2023
@@ -558,6 +558,8 @@ def test_union_with_missing_values_on_both_sides(nulls_fixture):
mi2 = MultiIndex.from_arrays([[1, nulls_fixture, 3]])
result = mi1.union(mi2)
expected = MultiIndex.from_arrays([[1, 3, nulls_fixture]])
# We don't particularly care about having levels[0] be float64, but it is
expected = expected.set_levels([expected.levels[0].astype(np.float64)])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like a bug in union, more specifically midx.append

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

agreed. i think i looked it at that for unrelated reasons a while back and didn't get anywhere.

@phofl phofl merged commit a1c6a22 into pandas-dev:main Feb 22, 2023
@phofl
Copy link
Member

phofl commented Feb 22, 2023

thx @jbrockmendel

@jbrockmendel jbrockmendel deleted the perf-assert_index_equal branch February 22, 2023 15:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
MultiIndex Performance Memory or execution speed performance Testing pandas testing functions or related to the test suite
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants