622.581.252.159 / 622_581_252_159.py
antitheft159's picture
Update 622_581_252_159.py
64d5d06 verified
import numpy as np
import pandas as pd
import os
for dirname, _, filenames in os.walk('/kaggle/input'):
for filename in filenames:
print(os.path.join(dirname, filename))
# Commented out IPython magic to ensure Python compatibility.
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
# %matplotlib inline
import seaborn as sns
import warnings
warnings.filterwarnings('ignore')
df=pd.read_csv('/content/Amazon Sale Report.csv')
df.shape
df.head()
df.tail()
df.info()
df.drop(['New', 'PendingS'], axis=1, inplace=True)
df.info()
pd.isnull(df)
pd.isnull(df).sum()
df.shape
df.dropna(inplace=True)
df.shape
df.shape
df.columns
df['ship-postal-code']=df['ship-postal-code'].astype('int')
df['ship-postal-code'].dtype
df['Date']=pd.to_datetime (df['Date'])
df.columns
df.rename(columns={'Qty':'Quantity'})
df.describe()
df.describe(include='object')
df[['Qty','Amount']].describe()
df.columns
ax=sns.countplot(x='Size', data=df)
ax=sns.countplot(x='Size', data=df)
for bars in ax.containers:
ax.bar_label(bars)
df.groupby(['Size'], as_index=False)['Qty'].sum().sort_values(by='Qty',ascending=False)
S_Qty=df.groupby(['Size'], as_index=False)['Qty'].sum().sort_values(by='Qty', ascending=False)
sns.barplot(x='Size', y='Qty', data=S_Qty)
sns.countplot(data=df, x='Courier Status', hue='Status')
plt.figure(figsize=(10, 5))
ax=sns.countplot(data=df, x='Courier Status', hue='Status')
plt.show()
df['Size'].hist()
df['Category'] = df['Category'].astype(str)
column_data = df['Category']
plt.figure(figsize=(10, 5))
plt.hist(column_data, bins=10, edgecolor='Black')
plt.xticks(rotation=90)
plt.show()
B2B_Check = df['B2B'].value_counts()
plt.pie(B2B_Check, labels=B2B_Check, autopct='%1.1f%%')
plt.show()
B2B_Check = df['B2B'].value_counts()
plt.pie(B2B_Check, labels=B2B_Check.index, autopct='%1.1f%%')
plt.show
a1 = df['Fulfilment'].value_counts()
fig, ax = plt.subplots()
ax.pie(a1, labels=a1.index, autopct='%1.1f%%', radius=0.7, wedgeprops=dict(width=0.6))
ax.set(aspect="equal")
plt.show()
x_data = df['Category']
y_data = df['Size']
plt.scatter(x_data, y_data)
plt.xlabel('Category')
plt.ylabel('Size')
plt.title('Scatter Plot')
plt.show()
plt.figure(figsize=(12, 6))
sns.countplot(data=df, x='ship-state')
plt.xlabel('ship-state')
plt.ylabel('count')
plt.title('Distribution of State')
plt.xticks(rotation=90)
plt.show()
top_10_state = df['ship-state'].value_counts().head(10)
plt.figure(figsize=(12, 6))
sns.countplot(data=df[df['ship-state'].isin(top_10_state.index)], x='ship-state')
plt.xlabel('ship-state')
plt.ylabel('count')
plt.title('Distribution of State')
plt.xticks(rotation=45)
plt.show()