for idx, val in enumerate(y):
try:
float_val = float(val)
if pd.notnull(float_val):
y_floats.append(float_val)
else:
indices_to_delete.append(idx)
After Change
print("And here is the number of missing (nan, None, etc.) values for this column:")
print(bad_rows.shape[0])
print("We will remove these values, and continue with training on the cleaned dataset")
X_df = X_df.dropna(subset=[self.output_column])
// Remove the output column from the dataset, and store it into the y varaible
y = list(X_df.pop(self.output_column))