I have to use qcut with a column called "PriceEuro", the combination of qcut and "PriceEuro" should be in another column that it must be created. The new column is called "Price_Category". The column "Price_Category" should contain one of these three labels: low, medium or high.
I checked here in stackoverflow and I found this:
Assignment of qcut as new column
After reading the previous link I did the following thing:
import pandas as pd
new_labels = ['low','medium','high']
new_column = pd.qcut(df_csv3.rank(method='first')['PriceEuro'], q=5, labels=new_labels, duplicates='drop')
df_csv3 = df_csv3.assign(Price_Category=new_column.values)
But, once I run it i get the following ValueError:
first not supported for non-numeric data