Code Monkey home page Code Monkey logo

exno2ds's Introduction

EXNO2DS-Exploratory Data Analysis

AIM:

To perform Exploratory Data Analysis on the given data set.

EXPLANATION:

The primary aim with exploratory analysis is to examine the data for distribution, outliers and anomalies to direct specific testing of your hypothesis.

ALGORITHM:

STEP 1: Import the required packages to perform Data Cleansing,Removing Outliers and Exploratory Data Analysis.

STEP 2: Replace the null value using any one of the method from mode,median and mean based on the dataset available.

STEP 3: Use boxplot method to analyze the outliers of the given dataset.

STEP 4: Remove the outliers using Inter Quantile Range method.

STEP 5: Use Countplot method to analyze in a graphical method for categorical data.

STEP 6: Use displot method to represent the univariate distribution of data.

STEP 7: Use cross tabulation method to quantitatively analyze the relationship between multiple variables.

STEP 8: Use heatmap method of representation to show relationships between two variables, one plotted on each axis.

CODING AND OUTPUT

Developed by: Sri Varshan P

Register no: 212222240104

import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns  
df=pd.read_csv("titanic_dataset.csv")
df

image

df.info()

image

df.shape

image

df.set_index("PassengerId",inplace=True)
df.describe()

image

df.shape

image

Categorical data analysis

df.nunique()

image

df["Survived"].value_counts()

image

per=(df["Survived"].value_counts()/df.shape[0]*100).round(2)
per

image

sns.countplot(data=df,x="Survived")

image

df

image

df.Pclass.unique()

image

df.rename(columns={'Sex':'Gender'},inplace=True)
df

image

Bivariate Analysis

sns.catplot(x="Gender",col="Survived",kind="count",data=df,height=5,aspect=.7)

image

sns.catplot(x="Survived",hue="Gender",data=df,kind="count")

image

df.boxplot(column="Age",by="Survived")

image

sns.scatterplot(x=df["Age"],y=df["Fare"])

image

sns.jointplot(x="Age",y="Fare",data=df)

image

Multivariate Analysis

fig, ax1 = plt.subplots(figsize=(8,5))
plt = sns.boxplot(ax=ax1,x='Pclass',y='Age',hue='Gender',data=df)

image

sns.catplot(data=df,col="Survived",x="Gender",hue="Pclass",kind="count")

image

Co-relation

corr=df.corr()
sns.heatmap(corr,annot=True)

image

sns.pairplot(df)

image

RESULT

We have performed Exploratory Data Analysis on the given data set successfully.

exno2ds's People

Contributors

dhinesh-sec avatar psrivarshan avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.