Skip to content

Commit 0cfb3e4

Browse files
Apply suggestions from code review
Co-authored-by: Jano Roelandt <48879098+ZlaTanskY@users.noreply.github.com>
1 parent 2ac2a3d commit 0cfb3e4

2 files changed

Lines changed: 7 additions & 6 deletions

File tree

cobra/preprocessing/preprocessor.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -492,9 +492,9 @@ def _get_variable_list(continuous_vars: list, discrete_vars: list) -> list:
492492
return var_list
493493

494494
def _check_nan_columns_and_drop_columns_containing_only_nan(data: pd.DataFrame) -> pd.DataFrame:
495-
"""Checkes how much missing values are in the dataframe and drops columns that contain only missing values.
496-
It also logs an error message displaying the percentage of missing values in the diffenent columns
497-
(columns are only diosplaied if they contain a missing values)
495+
"""Checks how much missing values are in the dataframe and drops columns that contain only missing values.
496+
It also logs an error message displaying the percentage of missing values in the different columns
497+
(columns are only displayed if they contain a missing values)
498498
499499
Parameters
500500
----------
@@ -504,7 +504,7 @@ def _check_nan_columns_and_drop_columns_containing_only_nan(data: pd.DataFrame)
504504
Returns
505505
-------
506506
pd.DataFrame
507-
Data without columns conatining only missing values
507+
Data without columns containing only missing values
508508
"""
509509

510510
# Check how much NaN values are in each variable
@@ -522,6 +522,6 @@ def _check_nan_columns_and_drop_columns_containing_only_nan(data: pd.DataFrame)
522522

523523
if to_drop:
524524
data = data.drop(to_drop, axis=1)
525-
logging.warning(f"Following variables contain only missing values and were droped: {to_drop}")
525+
logging.warning(f"Following variables contain only missing values and were dropped: {to_drop}")
526526

527527
return data

tests/preprocessing/test_preprocessor.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,8 @@ def test_mutable_train_data_fit_transform(self, mocker: MockerFixture):
185185
[
186186
# example 1
187187
(pd.DataFrame({
188-
"a":[1,8,np.nan],
188+
"a":[1, 8 , np.nan],
189+
189190
"b":[np.nan,8,np.nan],
190191
"c":[np.nan,np.nan,np.nan],
191192
"d":[np.nan,np.nan,5],

0 commit comments

Comments
 (0)