Skip to content

Commit aea73b2

Browse files
author
Brendan Herger
committed
Changing fixed_value references to constant
1 parent a6296a3 commit aea73b2

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

sklearn_pandas/categorical_imputer.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,16 +64,16 @@ def __init__(
6464
self.replacement = replacement
6565
self.strategy = strategy
6666

67-
strategies = ['fixed_value', 'most_frequent']
67+
strategies = ['constant', 'most_frequent']
6868
if self.strategy not in strategies:
6969
raise ValueError(
7070
'Strategy {0} not in {1}'.format(self.strategy, strategies)
7171
)
7272

73-
if self.strategy == 'fixed_value' and self.replacement is None:
73+
if self.strategy == 'constant' and self.replacement is None:
7474
raise ValueError(
7575
'Please specify a value for \'replacement\''
76-
'when using the fixed_value strategy.'
76+
'when using the constant strategy.'
7777
)
7878

7979
def fit(self, X, y=None):
@@ -97,7 +97,7 @@ def fit(self, X, y=None):
9797
X = X[~mask]
9898
if self.strategy == 'most_frequent':
9999
modes = pd.Series(X).mode()
100-
elif self.strategy == 'fixed_value':
100+
elif self.strategy == 'constant':
101101
modes = np.array([self.replacement])
102102
if modes.shape[0] == 0:
103103
raise ValueError('Data is empty or all values are null')

0 commit comments

Comments
 (0)