text_plain_output_1.png
import matplotlib.pyplot as plt

import pandas as pd

import seaborn as sns

traindf = pd.read_csv('/kaggle/input/bigmart-sales-data/Train.csv')
testdf = pd.read_csv('/kaggle/input/bigmart-sales-data/Test.csv')

traindf.dtypes

traindf.describe().round(3)

traindf.isna().sum()

df = pd.concat([traindf, testdf], axis=0)
df.shape
df.isnull().sum()

df = df.dropna(subset=['Item_Weight', 'Outlet_Size', 'Item_Outlet_Sales'])

df_itemwt = df.Item_Weight.value_counts().reset_index().rename(columns={'index': 'Item_Weight', 'Item_Weight': 'Number_Of_Items'})
df_itemwt_sorted = df_itemwt.sort_values(by='Number_Of_Items', ascending=False).head(20).reset_index(drop=True)
df_itemwt_sorted

sns.histplot(data=df, x='Item_Weight', kde=True, color='orange')
plt.show()
sns.barplot(y='Item_Weight', x='Number_Of_Items', data=df_itemwt_sorted, palette='autumn', order=df_itemwt_sorted['Item_Weight'], orient='h')
plt.ylabel('Weight of Items')
plt.xlabel('Number of Items')
plt.title('Items with different weights')
plt.show()