File tree 1 file changed +10
-11
lines changed
1 file changed +10
-11
lines changed Original file line number Diff line number Diff line change @@ -360,15 +360,14 @@ def test_loc_label_slicing(self):
360
360
def test_apply_datetime_tz_issue (self ):
361
361
# GH 29052
362
362
363
- df = DataFrame (
364
- data = [0 , 1 , 2 ],
365
- index = [
366
- pd .Timestamp ("2019-03-15 12:34:31.909000+0000" , tz = "UTC" ),
367
- pd .Timestamp ("2019-03-15 12:34:34.359000+0000" , tz = "UTC" ),
368
- pd .Timestamp ("2019-03-15 12:34:34.660000+0000" , tz = "UTC" ),
369
- ],
370
- )
371
- df2 = df .apply (lambda x : x .name , axis = 1 )
363
+ timestamps = [
364
+ pd .Timestamp ("2019-03-15 12:34:31.909000+0000" , tz = "UTC" ),
365
+ pd .Timestamp ("2019-03-15 12:34:34.359000+0000" , tz = "UTC" ),
366
+ pd .Timestamp ("2019-03-15 12:34:34.660000+0000" , tz = "UTC" ),
367
+ ]
368
+ df = DataFrame (data = [0 , 1 , 2 ], index = timestamps )
369
+ result = df .apply (lambda x : x .name , axis = 1 )
370
+ expected = pd .Series (index = timestamps , data = timestamps )
371
+
372
+ tm .assert_series_equal (result , expected )
372
373
373
- assert df [0 ].keys ().dtype == df2 .dtypes
374
- assert (df [0 ].keys ().values == df2 .values ).all ()
You can’t perform that action at this time.
0 commit comments