Skip to content

Breakage when setting MultiIndex with a mutable sequence #2200

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

Closed
ghost opened this issue Nov 8, 2012 · 0 comments
Closed

Breakage when setting MultiIndex with a mutable sequence #2200

ghost opened this issue Nov 8, 2012 · 0 comments
Labels
Bug Output-Formatting __repr__ of pandas objects, to_string
Milestone

Comments

@ghost
Copy link

ghost commented Nov 8, 2012

import pandas as pd
df=pd.DataFrame({"a":[1,2,3],"b":[4,5,6],"c":[7,8,9]}).set_index(["a","b"])
l=list(df.index)
l[0]=("faz","boo")
df.index=l
print df
# all good
l[0]=["faz","boo"]
df.index=l
print df
# badness

If this acceptable usage and index entries must be immutable, failing early would be good.

Note: If you get an UnboundLocalError Exception, That's an un-related issue, PR fix as soon
as travis is green.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Output-Formatting __repr__ of pandas objects, to_string
Projects
None yet
Development

No branches or pull requests

1 participant