Skip to content

ix setting with enlargement results in stale caches. #4939

Closed
@dalejung

Description

@dalejung

When doing setting with enlargement like:

import pandas as pd
panel = pd.util.testing.makePanel()
pd.ix[0] # get first item into cache
panel.ix[:, :, 'A+1'] = panel.ix[:, :, 'A'] + 1
assert "A+1" in panel.ix[0].columns # fails due to stale item cache
assert "A+1" in panel.ix[1].columns # succeeds

The same thing happens with DataFrames.

df = pd.util.testing.makeDataFrame()
df['A'] # cache series
df.ix["Hello Friend"] = df.ix[0]
assert "Hello Friend" in df['A'].index # fails
assert "Hello Friend" in df['B'].index # success

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugIndexingRelated to indexing on series/frames, not to indexes themselves

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions