ix setting with enlargement results in stale caches. (original) (raw)
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