Skip to content

Commit fea65c8

Browse files
code sample for pandas-dev#46837
1 parent 4a45787 commit fea65c8

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

bisect/46837.py

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# BUG: Setting multiple values via .loc produces NaNs with MultiIndex #46837
2+
3+
import pandas as pd
4+
5+
print(pd.__version__)
6+
7+
i = pd.MultiIndex.from_product([(0, 1), (2, 3)])
8+
s = pd.Series([True] * 4, index=i)
9+
10+
expected = s.copy()
11+
12+
s.loc[0, :] = s.loc[0, :]
13+
print(s)
14+
15+
pd.testing.assert_series_equal(s, expected)

0 commit comments

Comments
 (0)