@@ -309,11 +309,11 @@ def test_transform_multiple(ts):
309
309
def test_dispatch_transform (tsframe ):
310
310
df = tsframe [::5 ].reindex (tsframe .index )
311
311
312
- grouped = df .groupby (lambda x : x .month , dropna = False )
312
+ grouped = df .groupby (lambda x : x .month )
313
313
314
314
filled = grouped .fillna (method = "pad" )
315
315
fillit = lambda x : x .fillna (method = "pad" )
316
- expected = df .groupby (lambda x : x .month , dropna = False ).transform (fillit )
316
+ expected = df .groupby (lambda x : x .month ).transform (fillit )
317
317
tm .assert_frame_equal (filled , expected )
318
318
319
319
@@ -412,10 +412,10 @@ def nsum(x):
412
412
return np .nansum (x )
413
413
414
414
results = [
415
- df .groupby ("col1" , dropna = False ).transform (sum )["col2" ],
416
- df .groupby ("col1" , dropna = False )["col2" ].transform (sum ),
417
- df .groupby ("col1" , dropna = False ).transform (nsum )["col2" ],
418
- df .groupby ("col1" , dropna = False )["col2" ].transform (nsum ),
415
+ df .groupby ("col1" ).transform (sum )["col2" ],
416
+ df .groupby ("col1" )["col2" ].transform (sum ),
417
+ df .groupby ("col1" ).transform (nsum )["col2" ],
418
+ df .groupby ("col1" )["col2" ].transform (nsum ),
419
419
]
420
420
for result in results :
421
421
tm .assert_series_equal (result , expected , check_names = False )
@@ -448,9 +448,7 @@ def test_groupby_transform_with_int():
448
448
)
449
449
)
450
450
with np .errstate (all = "ignore" ):
451
- result = df .groupby ("A" , dropna = False ).transform (
452
- lambda x : (x - x .mean ()) / x .std ()
453
- )
451
+ result = df .groupby ("A" ).transform (lambda x : (x - x .mean ()) / x .std ())
454
452
expected = DataFrame (
455
453
dict (B = np .nan , C = Series ([- 1 , 0 , 1 , - 1 , 0 , 1 ], dtype = "float64" ))
456
454
)
@@ -614,7 +612,8 @@ def test_cython_transform_series(op, args, targop):
614
612
615
613
# series
616
614
for data in [s , s_missing ]:
617
- expected = data .groupby (labels , dropna = False ).transform (targop )
615
+ # print(data.head())
616
+ expected = data .groupby (labels ).transform (targop )
618
617
619
618
tm .assert_series_equal (expected , data .groupby (labels ).transform (op , * args ))
620
619
tm .assert_series_equal (expected , getattr (data .groupby (labels ), op )(* args ))
0 commit comments