text_plain_output_1.png image_output_1.png
import matplotlib.pyplot as plt

import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)

import seaborn as sns

import seaborn as sns
import matplotlib.pyplot as plt
sns.set_style('whitegrid')

train = pd.read_csv('../input/widsdatathon2022/train.csv')
test = pd.read_csv('../input/widsdatathon2022/test.csv')
submission = pd.read_csv('../input/widsdatathon2022/sample_solution.csv')

train = pd.read_csv('../input/widsdatathon2022/train.csv')

train.drop(columns=['id'], axis=1, inplace=True)

train.isna().sum()

train.shape

x = train.corr()

plt.xticks(rotation=90)

df = pd.DataFrame(train['facility_type'].value_counts().head(10))
df['facility'] = df.index
df.rename(columns={'facility_type': 'count'}, inplace=True)
df['%share'] = df['count'] / df['count'].sum()
df.drop(columns=['count'], inplace=True)
df.reset_index(drop=True)
plt.figure(figsize=(12, 6))
ax = sns.barplot(y='facility', x='%share', data=df)
for i in ax.containers:
    ax.bar_label(i)
plt.title('Distribution of Top 10 Facilities in Buildings in %')
plt.show()