When I apply this condition to my output (y). It is giving me this error in Jupyter Notebook.
Condition
conditions = [
(df['Please mention your Previous Semester GPA?'] < 2.3),
(df['Please mention your Previous Semester GPA?'] >= 2.3) & (df['Please mention your Previous Semester GPA?'] < 3),
(df['Please mention your Previous Semester GPA?'] >= 3)
]
values = ['High Chances of Bad Marks', 'Average Marks', 'High Chances of Good Marks']
df['Results'] = np.select(conditions, values)
y=df['Results']
y
Error
SettingWithCopyWarning:
A value is trying to be set on a copy of a slice from a DataFrame.
Try using .loc[row_indexer,col_indexer] = value instead
See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy
df['Results'] = np.select(conditions, values)