File tree 1 file changed +18
-0
lines changed
1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -890,6 +890,24 @@ def test_pivot_dtaccessor(self):
890
890
index = ['X' , 'Y' ], columns = exp_col )
891
891
tm .assert_frame_equal (result , expected )
892
892
893
+ def test_daily (self ):
894
+ rng = date_range ('1/1/2000' , '12/31/2004' , freq = 'D' )
895
+ ts = Series (np .random .randn (len (rng )), index = rng )
896
+
897
+ annual = pivot_table (DataFrame (ts ), index = ts .index .year ,
898
+ columns = ts .index .dayofyear )
899
+ annual .columns = annual .columns .droplevel (0 )
900
+
901
+ doy = np .asarray (ts .index .dayofyear )
902
+
903
+ for i in range (1 , 367 ):
904
+ subset = ts [doy == i ]
905
+ subset .index = [x .year for x in subset .index ]
906
+
907
+ result = annual [i ].dropna ()
908
+ tm .assert_series_equal (result , subset , check_names = False )
909
+ assert result .name == i
910
+
893
911
def test_pivot_table_with_iterator_values (self ):
894
912
# GH 12017
895
913
aggs = {'D' : 'sum' , 'E' : 'mean' }
You can’t perform that action at this time.
0 commit comments