data-science-types
data-science-types copied to clipboard
test_frame_iloc fails on Pandas 1.2
tests/pandas_test.py line 92 fails on Pandas 1.2
Extracting the relevant code
import pandas as pd
df: pd.DataFrame = pd.DataFrame(
[[1.0, 2.0], [4.0, 5.0], [7.0, 8.0]],
index=["cobra", "viper", "sidewinder"],
columns=["max_speed", "shield"],
)
s: "pd.Series[float]" = df["shield"].copy()
df.iloc[0] = s
Results in
ValueError: could not broadcast input array from shape (3) into shape (2)
This runs fine on Pandas 1.1.5