Skip to content

Commit

Permalink
code sample for pandas-dev#46955
Browse files Browse the repository at this point in the history
  • Loading branch information
simonjayhawkins committed May 17, 2022
1 parent 2973996 commit a6cfcd8
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions bisect/46955.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# BUG: index_col=False doesn't work for unequal length of data #46955

from io import StringIO

import pandas as pd

print(pd.__version__)


TESTDATA = StringIO(
"""
0.5 0.03
0.1 0.2 0.3 2
0.2 0.1 0.1 0.3
0.5 0.03
0.1 0.2 0.3 2
"""
)

df = pd.read_csv(TESTDATA, sep=" +", header=None, index_col=False, engine="python")

print(df)

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]})
pd.testing.assert_frame_equal(df, expected)

0 comments on commit a6cfcd8

Please sign in to comment.