Skip to content

Commit 068bd53

Browse files
code sample for pandas-dev#37711
1 parent c1cb3a8 commit 068bd53

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

bisect/37711.py

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import pandas as pd
2+
3+
print(pd.__version__)
4+
5+
s = pd.Series(
6+
[1, 2, 3], index=pd.MultiIndex.from_tuples([("a", "A"), ("b", "B"), ("c", "C")])
7+
)
8+
df = s.to_frame()
9+
print(
10+
s.loc[
11+
("a",),
12+
]
13+
)
14+
print(
15+
df.loc[
16+
("a",),
17+
]
18+
)
19+
20+
df.loc[
21+
("a",),
22+
] = 0
23+
24+
print(df)

0 commit comments

Comments
 (0)