44import numpy as np
55import pytest
66
7- from pandas ._libs import groupby
7+ from pandas ._libs . groupby import group_cumprod_float64 , group_cumsum
88
99from pandas .core .dtypes .common import ensure_platform_int , is_timedelta64_dtype
1010
@@ -545,14 +545,14 @@ def _check_cython_group_transform_cumulative(pd_op, np_op, dtype):
545545def test_cython_group_transform_cumsum (any_real_dtype ):
546546 # see gh-4095
547547 dtype = np .dtype (any_real_dtype ).type
548- pd_op , np_op = groupby . group_cumsum , np .cumsum
548+ pd_op , np_op = group_cumsum , np .cumsum
549549 _check_cython_group_transform_cumulative (pd_op , np_op , dtype )
550550
551551
552552def test_cython_group_transform_cumprod ():
553553 # see gh-4095
554554 dtype = np .float64
555- pd_op , np_op = groupby . group_cumprod_float64 , np .cumproduct
555+ pd_op , np_op = group_cumprod_float64 , np .cumproduct
556556 _check_cython_group_transform_cumulative (pd_op , np_op , dtype )
557557
558558
@@ -567,21 +567,21 @@ def test_cython_group_transform_algos():
567567 data = np .array ([[1 ], [2 ], [3 ], [np .nan ], [4 ]], dtype = "float64" )
568568 actual = np .zeros_like (data )
569569 actual .fill (np .nan )
570- groupby . group_cumprod_float64 (actual , data , labels , ngroups , is_datetimelike )
570+ group_cumprod_float64 (actual , data , labels , ngroups , is_datetimelike )
571571 expected = np .array ([1 , 2 , 6 , np .nan , 24 ], dtype = "float64" )
572572 tm .assert_numpy_array_equal (actual [:, 0 ], expected )
573573
574574 actual = np .zeros_like (data )
575575 actual .fill (np .nan )
576- groupby . group_cumsum (actual , data , labels , ngroups , is_datetimelike )
576+ group_cumsum (actual , data , labels , ngroups , is_datetimelike )
577577 expected = np .array ([1 , 3 , 6 , np .nan , 10 ], dtype = "float64" )
578578 tm .assert_numpy_array_equal (actual [:, 0 ], expected )
579579
580580 # timedelta
581581 is_datetimelike = True
582582 data = np .array ([np .timedelta64 (1 , "ns" )] * 5 , dtype = "m8[ns]" )[:, None ]
583583 actual = np .zeros_like (data , dtype = "int64" )
584- groupby . group_cumsum (actual , data .view ("int64" ), labels , ngroups , is_datetimelike )
584+ group_cumsum (actual , data .view ("int64" ), labels , ngroups , is_datetimelike )
585585 expected = np .array (
586586 [
587587 np .timedelta64 (1 , "ns" ),
0 commit comments