'convert price to groups of price category getting (ValueError: Bin labels must be one fewer than the number of bin edges)

category= pd.cut(df.price,bins=[75000,100000,250000,500000,1000000,2000000,4000000,7700000],labels=['7','6','5','4','3','2','1','0'])
df.insert(5,'price category',category)

help me out to find what is the mistake i have made



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source