data-science-types icon indicating copy to clipboard operation
data-science-types copied to clipboard

test_frame_iloc fails on Pandas 1.2

Open EdwardJRoss opened this issue 4 years ago • 0 comments

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

EdwardJRoss avatar Jan 08 '21 10:01 EdwardJRoss