File tree Expand file tree Collapse file tree 2 files changed +7
-28
lines changed
Expand file tree Collapse file tree 2 files changed +7
-28
lines changed Original file line number Diff line number Diff line change 1818from pandas .tests .indexes .common import Base
1919
2020
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+
2328
2429@pytest .fixture (params = zeros )
2530def zero (request ):
Original file line number Diff line number Diff line change @@ -1974,32 +1974,6 @@ def add_nans_panel4d(panel4d):
19741974 return panel4d
19751975
19761976
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-
20031977class TestSubDict (dict ):
20041978
20051979 def __init__ (self , * args , ** kwargs ):
You can’t perform that action at this time.
0 commit comments