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

TST: test loc index df with a MultiIndex and constituent IntervalIndex #52811

Closed
wants to merge 1 commit into from

Conversation

asdinara
Copy link

@jorisvandenbossche or @noatamir

@rhshadrach rhshadrach added MultiIndex Interval Interval data type labels Apr 21, 2023

def test_loc_multiindex_and_intervalindex():
#https://github.com/pandas-dev/pandas/issues/25298
#test to index the dataframe with a MultiIndex and IntervalIndex
Copy link
Member

Choose a reason for hiding this comment

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

You can remove all comments except the link to the GitHub issue

mi = pd.MultiIndex.from_arrays([["aa", "aa", "bb", "bb", "cc", "cc"], ii])
data = [(1, 2), (3, 4), (5, 6), (7, 8), (9, 10), (11, 12)]
df = pd.DataFrame(data, columns=['k', 'l'], index=mi)
result = pd.DataFrame({'k': [5], 'l': [6]}, index=pd.MultiIndex.from_tuples([('bb', pd.Interval(2, 5))], names=[None, None]))
Copy link
Member

Choose a reason for hiding this comment

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

Can you run pre-commit? This line is too long

@phofl phofl added the Sprints Sprint Pull Requests label Apr 21, 2023
@github-actions
Copy link
Contributor

This pull request is stale because it has been open for thirty days with no activity. Please update and respond to this comment if you're still interested in working on this.

@github-actions github-actions bot added the Stale label May 22, 2023
@mroeschke
Copy link
Member

Thanks for the pull request, but it appears to have gone stale. If interested in continuing, please merge in the main branch, address any review comments and/or failing tests, and we can reopen.

@mroeschke mroeschke closed this May 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Interval Interval data type MultiIndex Sprints Sprint Pull Requests Stale
Projects
None yet
Development

Successfully merging this pull request may close these issues.

IntervalIndex level in MultiIndex does not work as expected
4 participants