Skip to content

Corrupted values in Panel when index is not unique #2441

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
rafaljozefowicz opened this issue Dec 6, 2012 · 0 comments
Closed

Corrupted values in Panel when index is not unique #2441

rafaljozefowicz opened this issue Dec 6, 2012 · 0 comments
Assignees
Labels
Milestone

Comments

@rafaljozefowicz
Copy link

import pandas as pd
from StringIO import StringIO
txt = """time,id,value
2012-10-20,1,1.5
2012-10-20,1,2.5
2012-10-21,1,1.5
"""
xxx = pd.read_csv(StringIO(txt), parse_dates=0)
print(xxx.set_index(["time"])[xxx.id == 1])
print(xxx.set_index(["time", "id"]).to_panel().value)

It prints out:
id value
time
2012-10-20 1 1.5
2012-10-20 1 2.5
2012-10-21 1 1.5

id 1
time
2012-10-20 1.5
2012-10-21 2.5

The value for panel on 2012-10-21 is incorrect.

I am using pandas 0.9.0

@ghost ghost assigned wesm Dec 7, 2012
@wesm wesm closed this as completed in 24133e8 Dec 7, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants