I try to add a new column "energy_class" to a dataframe "df_energy" which it contains the string "high" if the "consumption_energy" value > 400, "medium" if the "consumption_energy" value is between 200 and 400, and "low" if the "consumption_energy" value is under 200.
I try to use np.where from numpy, but I see that numpy.where(condition[, x, y])
treat only two condition not 3 like in my case.
Any idea to help me please?
Thank you in advance
question from:https://stackoverflow.com/questions/39109045/numpy-where-with-multiple-conditions