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

check on 03.05 in notebooks_v1 #381

Open
maxvolpi opened this issue Sep 12, 2023 · 1 comment
Open

check on 03.05 in notebooks_v1 #381

maxvolpi opened this issue Sep 12, 2023 · 1 comment

Comments

@maxvolpi
Copy link

I think that in the paragraph on Explicit MultiIndex constructors che code:

pd.MultiIndex(levels=[['a', 'b'], [1, 2]],
labels=[[0, 0, 1, 1], [0, 1, 0, 1]])

should be replaced with:

pd.MultiIndex(levels=[['a', 'b'], [1, 2]],
codes=[[0, 0, 1, 1], [0, 1, 0, 1]])

Could you please check. It worked on my computer with codes, but I got the error message:

pd.MultiIndes.new() got an unexpected keywor argument for "labels"

@Moataz-Elmesmary
Copy link

The pd.MultiIndex constructor better use the codes parameter instead of labels to specify the levels and labels for a MultiIndex object. and it should work as expected without any errors.

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

No branches or pull requests

2 participants