ix setting with enlargement results in stale caches. · Issue #4939 · pandas-dev/pandas (original) (raw)
Navigation Menu
- GitHub Copilot Write better code with AI
- GitHub Models New Manage and compare prompts
- GitHub Advanced Security Find and fix vulnerabilities
- Actions Automate any workflow
- Codespaces Instant dev environments
- Issues Plan and track work
- Code Review Manage code changes
- Discussions Collaborate outside of code
- Code Search Find more, search less
- Explore
- Pricing
Provide feedback
Saved searches
Use saved searches to filter your results more quickly
Appearance settings
Description
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