image_output_1.png
import matplotlib.pyplot as plt

import pandas as pd

import seaborn as sns

import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
sns.set(font_scale=1.25)

df = pd.read_csv('/kaggle/input/oyo-hotel-rooms/OYO_HOTEL_ROOMS.csv')

df.drop(columns=['Unnamed: 0'], inplace=True)
df.columns = df.columns.str.lower()

df.shape

df.isna().sum()

df.dropna(inplace=True)

filt_loc = df.location.str.contains(',')
F_index = filt_loc.loc[lambda x: x == False].index
df.drop(index=F_index, inplace=True)
df.reset_index(drop=True, inplace=True)

df['city'] = df.location.apply(lambda x: x.rsplit(',', 1)[1])

myplot_city = sns.barplot(x=df.city.value_counts().index[:4],y=df.city.value_counts()[:4])
myplot_city.set(xlabel='City',ylabel='No. of Hotels')
plt.show()

myplot_price = sns.histplot(df.price)
plt.show()

df[(df.price > 800) & (df.price < 1400)].shape[0] / df.shape[0]

df.price.mean()

df.price.median()

grp_Bangalore = df[df.city.str.contains('Bangalore')]
sns.histplot(grp_Bangalore.price, kde=True)
plt.show()