22from numpy import nan
33import pytest
44
5- from pandas ._libs import groupby , lib , reduction
5+ from pandas ._libs import groupby , lib , reduction as libreduction
66
77from pandas .core .dtypes .common import ensure_int64
88
@@ -18,7 +18,7 @@ def test_series_grouper():
1818
1919 labels = np .array ([- 1 , - 1 , - 1 , 0 , 0 , 0 , 1 , 1 , 1 , 1 ], dtype = np .int64 )
2020
21- grouper = reduction .SeriesGrouper (obj , np .mean , labels , 2 , dummy )
21+ grouper = libreduction .SeriesGrouper (obj , np .mean , labels , 2 , dummy )
2222 result , counts = grouper .get_result ()
2323
2424 expected = np .array ([obj [3 :6 ].mean (), obj [6 :].mean ()])
@@ -34,7 +34,7 @@ def test_series_bin_grouper():
3434
3535 bins = np .array ([3 , 6 ])
3636
37- grouper = reduction .SeriesBinGrouper (obj , np .mean , bins , dummy )
37+ grouper = libreduction .SeriesBinGrouper (obj , np .mean , bins , dummy )
3838 result , counts = grouper .get_result ()
3939
4040 expected = np .array ([obj [:3 ].mean (), obj [3 :6 ].mean (), obj [6 :].mean ()])
@@ -120,31 +120,31 @@ class TestMoments:
120120class TestReducer :
121121 def test_int_index (self ):
122122 arr = np .random .randn (100 , 4 )
123- result = reduction .compute_reduction (arr , np .sum , labels = Index (np .arange (4 )))
123+ result = libreduction .compute_reduction (arr , np .sum , labels = Index (np .arange (4 )))
124124 expected = arr .sum (0 )
125125 assert_almost_equal (result , expected )
126126
127- result = reduction .compute_reduction (
127+ result = libreduction .compute_reduction (
128128 arr , np .sum , axis = 1 , labels = Index (np .arange (100 ))
129129 )
130130 expected = arr .sum (1 )
131131 assert_almost_equal (result , expected )
132132
133133 dummy = Series (0.0 , index = np .arange (100 ))
134- result = reduction .compute_reduction (
134+ result = libreduction .compute_reduction (
135135 arr , np .sum , dummy = dummy , labels = Index (np .arange (4 ))
136136 )
137137 expected = arr .sum (0 )
138138 assert_almost_equal (result , expected )
139139
140140 dummy = Series (0.0 , index = np .arange (4 ))
141- result = reduction .compute_reduction (
141+ result = libreduction .compute_reduction (
142142 arr , np .sum , axis = 1 , dummy = dummy , labels = Index (np .arange (100 ))
143143 )
144144 expected = arr .sum (1 )
145145 assert_almost_equal (result , expected )
146146
147- result = reduction .compute_reduction (
147+ result = libreduction .compute_reduction (
148148 arr , np .sum , axis = 1 , dummy = dummy , labels = Index (np .arange (100 ))
149149 )
150150 assert_almost_equal (result , expected )
0 commit comments