Skip to content

REGR: invalid cache after take operation with non-consolidated dataframe #35521

Closed
@on55

Description

@on55

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:

A
  code startdate
0    a         0

expected output:

A
  code startdate
0    A         0

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugInternalsRelated to non-user accessible pandas implementationRegressionFunctionality that used to work in a prior pandas version

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions