Skip to content

Corrupted values in Panel when index is not unique #2441

@rafaljozefowicz

Description

@rafaljozefowicz

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

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions