REGR: invalid cache after take operation with non-consolidated dataframe · Issue #35521 · pandas-dev/pandas (original) (raw)
a program run ok with pandas 1.0.5, but after upgrade to 1.1.0. it fail.
i found sometimes when I change one cell of dataframe value, print(df) and it doesn't change.
but i use ==, it says changed.
for example: original cell value is A, then i change cell value to B. A=B
print df, it show still A
df.at(x, x) == B, it says TRUE.
MarcoGorelli's edit: here's a reproducible example:
import pandas as pd
position = pd.DataFrame(columns=["code", "startdate"])
position = position.append([{"code": "a", "startdate": 0}])
# These two lines should not change anything.
# BUT, commenting either of them out makes this code run as intendeed
position["code"] == "A"
position[position["startdate"] == 0]
position.at[0, "code"] = "A"
print(position.at[0, "code"])
print(position)
output:
expected output: