text_plain_output_1.png
import pandas as pd

df = pd.read_csv('../input/swiggy-bangalore/Swiggy Bangalore.csv')

df = df.drop(['Offer'], axis=1)

df_new = df.drop(['Rating', 'URL'], axis=1)

category = df_new['Category'].value_counts(ascending=False)
category

category_less_then_100 = category[category < 100]
category_less_then_100

def handle_categgory(value):
    if value in category_less_then_100:
        return 'Others'
    else:
        return value
df_new['Category'] = df_new['Category'].apply(handle_categgory)
df_new['Category'].value_counts()