File tree Expand file tree Collapse file tree 1 file changed +7
-10
lines changed Expand file tree Collapse file tree 1 file changed +7
-10
lines changed Original file line number Diff line number Diff line change 4
4
import warnings
5
5
from abc import ABC , abstractmethod
6
6
from collections .abc import Hashable , Iterator , Mapping , Sequence
7
- from dataclasses import dataclass
7
+ from dataclasses import dataclass , field
8
8
from typing import (
9
9
TYPE_CHECKING ,
10
10
Any ,
@@ -519,17 +519,14 @@ class UniqueGrouper(Grouper):
519
519
pass
520
520
521
521
522
- @dataclass ( init = False )
522
+ @dataclass
523
523
class BinGrouper (Grouper ):
524
- def __init__ (self , bins , cut_kwargs : Mapping | None ):
525
- if duck_array_ops .isnull (bins ).all ():
526
- raise ValueError ("All bin edges are NaN." )
524
+ bins : Any # TODO: What is the typing?
525
+ cut_kwargs : Mapping = field (default_factory = dict )
527
526
528
- if cut_kwargs is None :
529
- cut_kwargs = {}
530
-
531
- self .bins = bins
532
- self .cut_kwargs = cut_kwargs
527
+ def __post_init__ (self ):
528
+ if duck_array_ops .isnull (self .bins ).all ():
529
+ raise ValueError ("All bin edges are NaN." )
533
530
534
531
535
532
@dataclass
You can’t perform that action at this time.
0 commit comments