Assignment Into Thin Air
Running on pandas 3.0, where copy-on-write is enabled and cannot be turned off.
import pandas as pd
df = pd.DataFrame({"qty": [1, 2, 3], "price": [4, 5, 6]})
df["qty"][df["price"] > 5] = 100
print(df["qty"].tolist())
What happens?
Sign in to answer questions and track your progress
Sign In