@@ -197,6 +197,24 @@ def test_multiple_date_cols_with_header(self):
197
197
df = read_csv (StringIO (data ), parse_dates = {'nominal' : [1 , 2 ]})
198
198
self .assert_ (not isinstance (df .nominal [0 ], basestring ))
199
199
200
+ def test_multiple_date_cols_index (self ):
201
+ data = """\
202
+ ID,date,NominalTime,ActualTime,TDew,TAir,Windspeed,Precip,WindDir
203
+ KORD1,19990127, 19:00:00, 18:56:00, 0.8100, 2.8100, 7.2000, 0.0000, 280.0000
204
+ KORD2,19990127, 20:00:00, 19:56:00, 0.0100, 2.2100, 7.2000, 0.0000, 260.0000
205
+ KORD3,19990127, 21:00:00, 20:56:00, -0.5900, 2.2100, 5.7000, 0.0000, 280.0000
206
+ KORD4,19990127, 21:00:00, 21:18:00, -0.9900, 2.0100, 3.6000, 0.0000, 270.0000
207
+ KORD5,19990127, 22:00:00, 21:56:00, -0.5900, 1.7100, 5.1000, 0.0000, 290.0000
208
+ KORD6,19990127, 23:00:00, 22:56:00, -0.5900, 1.7100, 4.6000, 0.0000, 280.0000"""
209
+
210
+ xp = read_csv (StringIO (data ), parse_dates = {'nominal' : [1 , 2 ]})
211
+ df = read_csv (StringIO (data ), parse_dates = {'nominal' : [1 , 2 ]},
212
+ index_col = 'nominal' )
213
+ assert_frame_equal (xp .set_index ('nominal' ), df )
214
+ df2 = read_csv (StringIO (data ), parse_dates = {'nominal' : [1 , 2 ]},
215
+ index_col = 0 )
216
+ assert_frame_equal (df2 , df )
217
+
200
218
def test_index_col_named (self ):
201
219
data = """\
202
220
ID,date,NominalTime,ActualTime,TDew,TAir,Windspeed,Precip,WindDir
0 commit comments