To read the given data and perform the univariate analysis with different types of plots.
Univariate analysis is basically the simplest form to analyze data. Uni means one and this means that the data has only one kind of variable. The major reason for univariate analysis is to use the data to describe. The analysis will take data, summarise it, and then find some pattern in the data.
Read the given data.
Get the information about the data.
Remove the null values from the data.
Mention the datatypes from the data.
Count the values from the data.
Do plots like boxplots,countplot,distribution plot,histogram plot.
Reg no:212222230030
Name:D.Dhanumalya
## SuperStore Data
import pandas as pd
import numpy as np
import seaborn as sns
df=pd.read_csv('SuperStore.csv')
df
df.head()
df.info()
df.describe()
df.isnull().sum()
df.dtypes
df['Customer Name'].value_counts()
sns.boxplot(x='Sales', data=df)
sns.countplot(x='State',data=df)
sns.distplot(df["Row ID"])
sns.histplot(x='State',data=df)
import matplotlib.pyplot as plt
df_count = df.groupby(by=["Category"]).count()
df_sum = df.groupby(by=["Category"]).sum()
labels=[]
for i in df_count.index:
labels.append(i)
plt.figure(figsize=(5,8))
colors = sns.color_palette('pastel')
myexplode = [0.1,0.1,0.1]
plt.pie(df_count["Sales"], colors = colors,explode = myexplode, labels=labels, autopct = "%0.0f%%",shadow = True)
plt.show()
## Diabetes Data
import pandas as pd
import numpy as np
import seaborn as sns
df=pd.read_csv('diabetes.csv')
df
df.head()
df.info()
df.describe()
df.isnull().sum()
df.dtypes
df['DiabetesPedigreeFunction'].value_counts()
sns.boxplot(x='BloodPressure', data=df)
sns.countplot(x='BMI',data=df)
sns.distplot(df["Outcome"])
sns.histplot(x='Age',data=df)
Thus we have read the given data and performed the univariate analysis with different types of plots.