dropping_indices = []
for index, row in df_2019.iterrows():
if ((row['color'] == 'green') & (row['volatility'] < 10 * row['mean_return'])) or (row['color'] == 'red') & (row['volatility'] >= 10 * row['mean_return']) :
dropping_indices.append(index)
print(row['volatility'])
print(row['mean_return'])
else:
continue
df_2019.drop(dropping_indices, inplace=True)
I'm not sure if it is catching anything, but it is definitely changing my matplotlib scatter plot