0% found this document useful (0 votes)
7 views

DAV Assign6

Uploaded by

Raj Joshi
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views

DAV Assign6

Uploaded by

Raj Joshi
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

Mayank Sagave kqr.

TE -CSe Roll No. Lyg


DAV
fu FINOLEX ACADEMY OF MANAGEMENT AND TECHNOLOGY, RATNAGIP

Assignment NO:s
Wite a pyton ode to plot linear regression usi ng
Seaborn ibrory
import Seaborn oas sns
inport matplat lib. pyplct as plt
X2 L51lo|S.202s]
YLlo, IS, 25130353

Sns- egplot Cx= X9=9)


plt. title('linegr Regre ssion")
Lplt. xla bel (x)
plt. ylabe) ('y)
plt. shoo)

Difference beteeN nUnpy and pandas

Numpy Pandas

)Supports Arrays Suppotts Data frame, Sene.

Homoyeneous type of dota.Heterogeneaus type of data.


) Missing Naluer not Supported, Supports handing missing data
iu)|Indering is Infeger Boolean Indexing is label -based.
)faster for numenca slightly Slower but more
computations |fegture nch.
FINOLEX ACADEMY OF MANAGEMENT ANDTECHNOLOGY, RATNAGIRI

Q3Oifference beth regplot and Implot.


Tegplot Implat
i)Reqires explicit Specifica- Accepts Data a Dotoframe
on ofx and s.. and column ames.

)Plotsaregression line for Plots reqression ineo


to vanables. Scatter plot for nultiple
Vaiables

R)less feaible Suitable for More flexible, allous for


Simple plcts Subplotting 6addiiona
paromeBers.

tu)Returns motolat lib Axes Retums facet Grid abiect


object

Q.4 Wile a Syrtex of plot unchon in motplotlsb (ibtary.


import cplotl;b py plot as p
plt t
pt plot( Xifmt, * Rwarqs)
X: X-coordinota oF the data pts.
: 9-oordi nateg of the data pts.
frnt: A format Sting that Cotrols the appearance of
he pot
kwargs: Additiona) keyord qrguments.
Matiank

FlNOLEX ACADEMY OF MANAGEMENT AND TECHNOLOGY, RATNAGIRI

QS DiFference bet matplotlib and Seaborn.


matpltli b Seabosn

)| AP\ is looleuel,provides Gne AP) is Highlevel., Stmplifes


grained Control. Complex plots.
i)De fault Stule is Basic and More yisualls appealing.
mìnimalistic defaut Style.

m Widely ged in other libraneBuit sn top at Matplotlkb.


and tools. seamlessly íntegnahes.
iu) Requàe more code for |Simplifiel customization with
Customizatton. fewer Ine of ode.

GSst dfferent libraies in python ed for \lisuakation.

)Seaborn
i)Plotla
i) ggplot
u) Pandas
i ) Plotnine
vi) Altair.
Fa FINOLEX ACADEMY OF MANAGEMENT AND TECHNOLOGY, RATNAGIP

Q.AWie a shot noe on Seaborm library

Seaborn is an amazing visualizatien libray for Statstica!


graphics plotting in python.(t parauides beautifu) defaut
styles color palette to make Startistica) plots_ more
attractue It is bullt on top mat ploctlib Rbrars 00d is
also cloSely integrated wt th the data Structures
fhom pandasL
Seqborn aims to make iSUalizotion the Central part ot
exploring and understonding data. It provides dataset
onented APls so that tue an Suitch beth di£ferent
Nisual repre sentations for the Same vanables fora
better understanding of the datase.
import nompy a4 np
import gRabosn sns
Sns set(
Style t white")

|S= hp random . RandomState Cio)


d= rs.normal Csize =loo)

Shs. histplot (à, kde -True.. color aim")


Q.sExploratory data analysis in python.
In puthon, exeDA Sa crucial shep inthe data
analysisproess that involves Studingexploring,
&_viSual izing info. to dive impsrtant insights.
To find patterns, trends, & relation ship in the data.
G9
niques
Suh a: indudinq valued Analysis
Daha cha eDApipeline ibraryPython
Clean 6ldentify pythoN.
Use
. inHao Explorqtory Missing methodsJike: analysis
Vanou
¬DA proudes 6 6
investigation.
additiond This t
rregulanties Handling Dirty
Data Analysis
.Biva
Univaniate
Anglysis Analyzing
nate "Checking data.the
dataset.
Reading pandS
racteristics is mokes
data to
Anaysis.
Multianate helps
the..data the FiNOLEX
handle ecosystem prouides ue
sinConsistencies
prof1ling 6 lf fhis
\alue thetor maininfo. An to ACADEMY
understandthe helps of
by 6 procedure essentia) formulate
in dirty statistiol
the Cialculation.
relationships Step for
data Strong OF
ropnate duplicates. whichincludes MANAGEMENT
data.techn iD
data, to
further
iques the
improves phase hypotheses
EDA tools
nature null visual AND
bet process
to 6 modeling in took
\value ize TECHNOLOGY,
&
tormatting
detect Yanables. the
af data oth
the of Seabarn,isualízatm.
data b
direct
dota
anemalies ditty Yonous
comprehensin
decisians.
patterns, RATNAGIRI
duplicate science its
clean errors.data Matplotl:
diverse
data
ing
DD

Functions
ldentify B.Consider method.
guch
Null (dentrfy
Decide
method valuey:
Remauing ing AMY
Decide Handing tt Such "dropna)'
Imputng data.
suingkeepinRemouing Sopbisticated
Dull Osing
more Handling
Yalue
Null cateqencal
In
Correcting data
Stand FINOLEX
on a Functiens estMates.pating
ualue, the on
a a
like interpolation.
regressiomgr mean.null ardizing
to ACADEMY
only duplicagte
Duplicate rouos an Null
strategyfor domain-Specific
'dupl: missing
isspellings a
duplicates & appropnate likeValue, onsistent OF
choase medianbolue or data MANAGEMENT
the he cated Value: cisNull()oY
Values Columns Values
s Usith (NaN, fermahs
Keep' orusing the or
C)' in fonad)
last handing mode Strategy AND
or most Statisia) coith
inconSistencie) &
op.duplicates(, the imputatian
techiquea
inp ith
None, TECHNOLOGY,
arameer.
ocCurrence (eg
drapduplicates0!. lication
dupliate dataset Suitable sing
ayinq 9ensibe
Dull tor inetc)
fo coNYering
Measures Values in RATNAGIRI
filUna hand Othe
uiapproqch. of defaults
otvalue: Dg handling ling dataset in
) LJing al
ian), python:
inadyertentBy density
if çolumn_name'T-med
valuenvaua,
aqgregating
duplkcate
RATNAGIRI uaing
the
plot
graphes
TECHNOLOGY, usith
duplicate
not Nialine
alignS
does True).
followlnq ph plt.
AND
&
remouing csv) (dfC sum) boxplot as
MANAGEMENT
decisim () (inplace pyplat as
lysis data. Ing
True)
inplace lot
name'fil
C)-sum C). drawhecatmaphistogram
plot
) pyp
anainfo.
valuable
remoue cex-axis
ylabel(y-axis')
pt. (x-gxis
xlabe
plt
when pd duplicated plot plot')
.title(line
plt
OF
bining thethe drop-dupliates
to matplotl:b b:
ACADEMYor
Com matplotli
appropriafe. o read.csv
null scatter
(aiy)
pltplot
Cx9)
of
that
caution pandais [column. Syntex 2.Scatter
plot:
plot:
line
J: xlabe)
aFINOLEX
objective CJ. Caf. plt.showC) scatter
ensuonq pd: a plot part
im import
Take import Wnte
= print print
ds. line plet. :plt
df df
Q.lo
CHistogram
)pt.hle
RATNAGIRL
TECHNOLOGY,
'y'data=d£) pt.ylabel("Density) ()Plt-showo
larm)
df)
AND
yeydata True)
MANAGEMENT coa P9plot-ou
pt
plot') Cxesx'ye cmap pyplot:a4
Sns nltttle(Nialin
plot) Shode plot)
plot!) Sns sns sns Hedtmap')
(' )
=lo Freque
label(
pt.y
OF ('Y-axis)
ylabe)l
plt G x} (dato,
pata') data, bing
ACADEMY
catter o Density as mtplotlib.
import
(Data')
ott
xlabe)
Seqborn
(xaBox segporn þorn
4. born
Yioline
plot violineplets-Density
plot: xlabel(' C Cdota,
FINOLEX 4tle('S plat: Sns.boxplot
3.Box
pt.show() Htle(
shouc) Seo shouCO kdeplot('
Shoo)
pl+.
S.
Heatnap
plt.shoao)
Sea hettmap 7.
Hstogram
ti4le
plt
import import pit.1ite import hist
import
plt.plt Shs. plt
F
pt. Snsplt- Sns plt

You might also like