<jupyter_start><jupyter_text><jupyter_code>from google.colab import drive
drive.mount('/content/drive/')<jupyter_output>Mounted at /content/drive/<jupyter_text>**Task - Exploratory Data Analysis - Retail****Name - <NAME>** ***TSF GRIP INTERNSHIP***                                           [link Dataset](https://drive.google.com/file/d/1lV7is1B566UQPYzzY8R2ZmOritTW299S/view)  Exploratory Data Analysis Exploratory data analysis means to explore given Datasets getting more info about our dataseet and sorting our dataset by using different libaries **Importing all library**<jupyter_code>import pandas as pd
import seaborn as sns
import numpy as np
import matplotlib.pyplot as plt 

%matplotlib inline<jupyter_output><empty_output><jupyter_text>**Reading dataset**<jupyter_code>df = pd.read_csv("/content/drive/MyDrive/Datasets/SampleSuperstore.csv.csv")
df.head()


df.info()
df.iterrows
df.describe()
df.isnull().any()<jupyter_output><empty_output><jupyter_text>**Number of Elements in Attributes of Dataset**<jupyter_code>df['Ship Mode'].value_counts()
df['Country'].value_counts()
df['City'].value_counts()
df['Segment'].value_counts()
df['State'].value_counts()
df['Region'].value_counts()
df['Category'].value_counts()
df['Sub-Category'].value_counts()<jupyter_output><empty_output><jupyter_text>*We observe that country and Postal code is not useful so we can drop this*<jupyter_code>df.drop(['Country','Postal Code'],axis=1,inplace=True)

df<jupyter_output><empty_output><jupyter_text>**Data Visualization**<jupyter_code>plt.figure(figsize=(8,8))
sns.heatmap(df.corr(),annot=True,cmap='YlOrRd')
plt.show()

sns.pairplot(df)
plt.show()
x=df.groupby(by='Category')[['Profit']].sum()
b=x.sort_values(by=['Profit'],ascending=True)
b.plot(kind='bar')
plt.show()<jupyter_output><empty_output><jupyter_text>From the Graph we can clearly see Technology making higest profit so lets focus on Furniture<jupyter_code>plt.figure(figsize=(6,6))
sns.barplot(x='Region',y='Profit',hue='Category',data=df)
plt.show()<jupyter_output><empty_output><jupyter_text>From the above graph we can clearly see lowes profit is from central Region<jupyter_code>plt.figure(figsize=(6,6))
sns.barplot(x='Region',y='Sales',hue='Category',data=df)
plt.show()<jupyter_output><empty_output><jupyter_text>From the Inspection Sales of Furniture is Greater than office Supplies But the Profit made by Furniture  is very less than Office Supplies<jupyter_code>plt.figure(figsize=(6,6))
df.groupby('Region')['Profit'].sum().plot(kind='pie',autopct='%1.1f%%')
plt.show()
subcategory_grpby= df.groupby(by='Sub-Category')[['Profit','Sales']].sum()
subprofit=subcategory_grpby.sort_values(by=['Profit'],ascending=True).plot(kind='bar',figsize=(7,7))<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.15653440116490716, 'fraction_numerical': 0.008736803785948308, 'mean_word_length': 8.378839590443686, 'pattern_counts': {'":': 0, '<': 37, '<?xml version=': 0, '>': 37, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '9', 'dir': 'jupyter-structured-clean-dedup', 'id': '415412', 'license': 'Apache-2.0', 'n_tokens_mistral': 1012, 'n_tokens_neox': 985, 'n_words': 167, 'path': 'Exploratory_Data_Analysis_Retail.ipynb', 'repo_name': 'FallenYT/-GRIPOCTOBER21', 'size': '2761'}