File tree 2 files changed +7
-28
lines changed
2 files changed +7
-28
lines changed Original file line number Diff line number Diff line change 18
18
from pandas .tests .indexes .common import Base
19
19
20
20
21
- zeros = tm .gen_zeros (5 )
22
- zeros = [x for x in zeros if not isinstance (x , Series )]
21
+ zeros = [box ([0 ] * 5 , dtype = dtype )
22
+ for box in [pd .Index , np .array ]
23
+ for dtype in [np .int64 , np .uint64 , np .float64 ]]
24
+ zeros .extend ([np .array (0 , dtype = dtype )
25
+ for dtype in [np .int64 , np .uint64 , np .float64 ]])
26
+ zeros .extend ([0 , 0.0 , long (0 )])
27
+
23
28
24
29
@pytest .fixture (params = zeros )
25
30
def zero (request ):
Original file line number Diff line number Diff line change @@ -1974,32 +1974,6 @@ def add_nans_panel4d(panel4d):
1974
1974
return panel4d
1975
1975
1976
1976
1977
- def gen_zeros (arr_len ):
1978
- """
1979
- For testing division by (or of) zero for Series or Indexes with the given
1980
- length, this gives variants of scalar zeros and vector zeros with different
1981
- dtypes.
1982
-
1983
- Generate variants of scalar zeros and all-zero arrays with the given
1984
- length.
1985
-
1986
- Parameters
1987
- ----------
1988
- arr_len : int
1989
-
1990
- Returns
1991
- -------
1992
- zeros : list
1993
- """
1994
- zeros = [box ([0 ] * arr_len , dtype = dtype )
1995
- for box in [pd .Series , pd .Index , np .array ]
1996
- for dtype in [np .int64 , np .uint64 , np .float64 ]]
1997
- zeros .extend ([np .array (0 , dtype = dtype )
1998
- for dtype in [np .int64 , np .uint64 , np .float64 ]])
1999
- zeros .extend ([0 , 0.0 , long (0 )])
2000
- return zeros
2001
-
2002
-
2003
1977
class TestSubDict (dict ):
2004
1978
2005
1979
def __init__ (self , * args , ** kwargs ):
You can’t perform that action at this time.
0 commit comments