Skip to content

Commit be300e8

Browse files
code sample for pandas-dev#46317
1 parent 19da16b commit be300e8

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

bisect/46317.py

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# BUG: Difference in CSV roundtrip between 1.3.5 and 1.4.1 #46317
2+
3+
import pandas as pd
4+
5+
print(pd.__version__)
6+
7+
df = pd.DataFrame(
8+
index=pd.MultiIndex.from_tuples([], names=["a", "b", "c"]), columns=["x"]
9+
)
10+
df.loc[(1, 2, 3)] = "bar"
11+
print(df)
12+
13+
expected = pd.DataFrame(
14+
["bar"],
15+
index=pd.MultiIndex.from_tuples([(1, 2, 3)], names=["a", "b", "c"]),
16+
columns=["x"],
17+
)
18+
pd.testing.assert_frame_equal(df, expected)

0 commit comments

Comments
 (0)