Skip to content

Commit

Permalink
TST: Add new test for flaky usecols (pandas-dev#15051)
Browse files Browse the repository at this point in the history
  • Loading branch information
gfyoung authored and jorisvandenbossche committed Jan 4, 2017
1 parent 6eb705f commit 098831d
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions pandas/io/tests/parser/usecols.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,26 @@ def test_usecols_with_parse_dates(self):
parse_dates=parse_dates)
tm.assert_frame_equal(df, expected)

# See gh-13604
s = """2008-02-07 09:40,1032.43
2008-02-07 09:50,1042.54
2008-02-07 10:00,1051.65
"""
parse_dates = [0]
names = ['date', 'values']
usecols = names[:]

index = Index([Timestamp('2008-02-07 09:40'),
Timestamp('2008-02-07 09:50'),
Timestamp('2008-02-07 10:00')],
name='date')
cols = {'values': [1032.43, 1042.54, 1051.65]}
expected = DataFrame(cols, index=index)

df = self.read_csv(StringIO(s), parse_dates=parse_dates, index_col=0,
usecols=usecols, header=None, names=names)
tm.assert_frame_equal(df, expected)

# See gh-14792
s = """a,b,c,d,e,f,g,h,i,j
2016/09/21,1,1,2,3,4,5,6,7,8"""
Expand Down

0 comments on commit 098831d

Please sign in to comment.