@@ -417,6 +417,27 @@ def test_describe_timedelta_values(self):
417
417
"max 5 days 00:00:00 0 days 05:00:00" )
418
418
assert repr (res ) == exp_repr
419
419
420
+ def test_describe_tz_values (self , tz_naive_fixture ):
421
+ tz = tz_naive_fixture
422
+ s1 = Series (range (5 ))
423
+ start = Timestamp (2018 , 1 , 1 )
424
+ end = Timestamp (2018 , 1 , 5 )
425
+ s2 = Series (date_range (start , end , tz = tz ))
426
+ df = pd .DataFrame ({'s1' : s1 , 's2' : s2 })
427
+
428
+ expected = DataFrame ({'s1' : [5 , np .nan , np .nan , np .nan , np .nan , np .nan ,
429
+ 2 , 1.581139 , 0 , 1 , 2 , 3 , 4 ],
430
+ 's2' : [5 , 5 , s2 .value_counts ().index [0 ], 1 ,
431
+ start .tz_localize (tz ),
432
+ end .tz_localize (tz ), np .nan , np .nan ,
433
+ np .nan , np .nan , np .nan , np .nan , np .nan ]},
434
+ index = ['count' , 'unique' , 'top' , 'freq' , 'first' ,
435
+ 'last' , 'mean' , 'std' , 'min' , '25%' , '50%' ,
436
+ '75%' , 'max' ]
437
+ )
438
+ res = df .describe (include = 'all' )
439
+ tm .assert_frame_equal (res , expected )
440
+
420
441
def test_reduce_mixed_frame (self ):
421
442
# GH 6806
422
443
df = DataFrame ({
0 commit comments