Skip to content

Commit

Permalink
Merge pull request #335 from ZJUEarthData/dev/Yongkang
Browse files Browse the repository at this point in the history
perf: The code has been improved to handle missing values.
  • Loading branch information
SanyHe authored Apr 27, 2024
2 parents 5339ffb + 0429766 commit 4b8f7c9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion geochemistrypi/data_mining/cli_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -312,9 +312,10 @@ def cli_pipeline(training_data_path: str, application_data_path: Optional[str] =
show_data_columns(data_selected.columns)
print("Note: The data set schema will remain the same after dropping the rows with missing values by specific columns.")
drop_data_selected = create_sub_data_set(data_selected)
data_selected_dropped = data_selected
for column_name in drop_data_selected.columns:
# Drop the rows with missing values
data_selected_dropped = data_selected.dropna(subset=[column_name])
data_selected_dropped = data_selected_dropped.dropna(subset=[column_name])
# Reset the index of the data set after dropping the rows with missing values.
data_selected_dropped = data_selected_dropped.reset_index(drop=True)
print("Successfully drop the rows with missing values.")
Expand Down

0 comments on commit 4b8f7c9

Please sign in to comment.