18
18
Categorical ,
19
19
CategoricalDtype ,
20
20
DataFrame ,
21
+ DatetimeIndex ,
21
22
Index ,
23
+ PeriodIndex ,
24
+ RangeIndex ,
22
25
Series ,
23
26
Timestamp ,
24
27
date_range ,
@@ -598,7 +601,7 @@ def test_sem(self, datetime_frame):
598
601
"C" : [1.0 ],
599
602
"D" : ["a" ],
600
603
"E" : Categorical (["a" ], categories = ["a" ]),
601
- "F" : pd . DatetimeIndex (["2000-01-02" ], dtype = "M8[ns]" ),
604
+ "F" : DatetimeIndex (["2000-01-02" ], dtype = "M8[ns]" ),
602
605
"G" : to_timedelta (["1 days" ]),
603
606
},
604
607
),
@@ -610,7 +613,7 @@ def test_sem(self, datetime_frame):
610
613
"C" : [np .nan ],
611
614
"D" : np .array ([np .nan ], dtype = object ),
612
615
"E" : Categorical ([np .nan ], categories = ["a" ]),
613
- "F" : pd . DatetimeIndex ([pd .NaT ], dtype = "M8[ns]" ),
616
+ "F" : DatetimeIndex ([pd .NaT ], dtype = "M8[ns]" ),
614
617
"G" : to_timedelta ([pd .NaT ]),
615
618
},
616
619
),
@@ -621,7 +624,7 @@ def test_sem(self, datetime_frame):
621
624
"I" : [8 , 9 , np .nan , np .nan ],
622
625
"J" : [1 , np .nan , np .nan , np .nan ],
623
626
"K" : Categorical (["a" , np .nan , np .nan , np .nan ], categories = ["a" ]),
624
- "L" : pd . DatetimeIndex (
627
+ "L" : DatetimeIndex (
625
628
["2000-01-02" , "NaT" , "NaT" , "NaT" ], dtype = "M8[ns]"
626
629
),
627
630
"M" : to_timedelta (["1 days" , "nan" , "nan" , "nan" ]),
@@ -635,7 +638,7 @@ def test_sem(self, datetime_frame):
635
638
"I" : [8 , 9 , np .nan , np .nan ],
636
639
"J" : [1 , np .nan , np .nan , np .nan ],
637
640
"K" : Categorical ([np .nan , "a" , np .nan , np .nan ], categories = ["a" ]),
638
- "L" : pd . DatetimeIndex (
641
+ "L" : DatetimeIndex (
639
642
["NaT" , "2000-01-02" , "NaT" , "NaT" ], dtype = "M8[ns]"
640
643
),
641
644
"M" : to_timedelta (["nan" , "1 days" , "nan" , "nan" ]),
@@ -652,15 +655,13 @@ def test_mode_dropna(self, dropna, expected):
652
655
"C" : [1 , np .nan , np .nan , np .nan ],
653
656
"D" : [np .nan , np .nan , "a" , np .nan ],
654
657
"E" : Categorical ([np .nan , np .nan , "a" , np .nan ]),
655
- "F" : pd .DatetimeIndex (
656
- ["NaT" , "2000-01-02" , "NaT" , "NaT" ], dtype = "M8[ns]"
657
- ),
658
+ "F" : DatetimeIndex (["NaT" , "2000-01-02" , "NaT" , "NaT" ], dtype = "M8[ns]" ),
658
659
"G" : to_timedelta (["1 days" , "nan" , "nan" , "nan" ]),
659
660
"H" : [8 , 8 , 9 , 9 ],
660
661
"I" : [9 , 9 , 8 , 8 ],
661
662
"J" : [1 , 1 , np .nan , np .nan ],
662
663
"K" : Categorical (["a" , np .nan , "a" , np .nan ]),
663
- "L" : pd . DatetimeIndex (
664
+ "L" : DatetimeIndex (
664
665
["2000-01-02" , "2000-01-02" , "NaT" , "NaT" ], dtype = "M8[ns]"
665
666
),
666
667
"M" : to_timedelta (["1 days" , "nan" , "1 days" , "nan" ]),
@@ -831,15 +832,15 @@ def test_sum_corner(self):
831
832
@pytest .mark .parametrize (
832
833
"index" ,
833
834
[
834
- tm . makeRangeIndex (0 ),
835
- tm . makeDateIndex ( 0 ),
836
- tm . makeNumericIndex ( 0 , dtype = int ),
837
- tm . makeNumericIndex ( 0 , dtype = float ),
838
- tm . makeDateIndex ( 0 , freq = "ME" ),
839
- tm . makePeriodIndex ( 0 ),
835
+ RangeIndex (0 ),
836
+ DatetimeIndex ([] ),
837
+ Index ([] , dtype = np . int64 ),
838
+ Index ([] , dtype = np . float64 ),
839
+ DatetimeIndex ([] , freq = "ME" ),
840
+ PeriodIndex ([], freq = "D" ),
840
841
],
841
842
)
842
- def test_axis_1_empty (self , all_reductions , index , using_array_manager ):
843
+ def test_axis_1_empty (self , all_reductions , index ):
843
844
df = DataFrame (columns = ["a" ], index = index )
844
845
result = getattr (df , all_reductions )(axis = 1 )
845
846
if all_reductions in ("any" , "all" ):
0 commit comments