Skip to content

Commit a6cfcd8

Browse files
code sample for pandas-dev#46955
1 parent 2973996 commit a6cfcd8

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

bisect/46955.py

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# BUG: index_col=False doesn't work for unequal length of data #46955
2+
3+
from io import StringIO
4+
5+
import pandas as pd
6+
7+
print(pd.__version__)
8+
9+
10+
TESTDATA = StringIO(
11+
"""
12+
0.5 0.03
13+
0.1 0.2 0.3 2
14+
0.2 0.1 0.1 0.3
15+
0.5 0.03
16+
0.1 0.2 0.3 2
17+
"""
18+
)
19+
20+
df = pd.read_csv(TESTDATA, sep=" +", header=None, index_col=False, engine="python")
21+
22+
print(df)
23+
24+
expected = pd.DataFrame({0: [0.5, 0.1, 0.2, 0.5, 0.1], 1: [0.03, 0.2, 0.1, 0.03, 0.2]})
25+
pd.testing.assert_frame_equal(df, expected)

0 commit comments

Comments
 (0)