0% found this document useful (0 votes)
4 views2 pages

Experiment 3

The document outlines a Python program designed to demonstrate the calculation of statistical measures including mean, median, mode, standard deviation, and variance using sample data. Each section provides code snippets for calculating these statistics with example outputs. The program utilizes libraries such as NumPy and statistics to perform the calculations.

Uploaded by

baruahnilimakash
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views2 pages

Experiment 3

The document outlines a Python program designed to demonstrate the calculation of statistical measures including mean, median, mode, standard deviation, and variance using sample data. Each section provides code snippets for calculating these statistics with example outputs. The program utilizes libraries such as NumPy and statistics to perform the calculations.

Uploaded by

baruahnilimakash
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

EXPERI

MENT3:

AIM:Runpyt
honprogramst
odemons
trat
etheus
eofmean,
medi
an,
mode,
standar
d
devi
ati
onandvar
iance.

1
.Mean

i
mpor
tnumpyasnp

#Sampl
edat
a

dat
a=[
12,
15,
14,
10,
18,
20,
22,
19]

#Cal
cul
atemean

mean=np.
mean(
dat
a)

pr
int
(f
"Mean:
{mean}
")

OUTPUT:(WRI
TETHEOUTPUTYOUGET)

2.
MEDI
AN

i
mpor
tnumpyasnp

#Sampl
edat
a

dat
a=[
12,
15,
14,
67,
18,
20,
22]

#Cal
cul
atemedi
an

medi
an=np.
medi
an(
dat
a)

pr
int
(f
"Medi
an:
{medi
an}
")

OUTPUT:(WRI
TETHEOUTPUTYOUGET)

3.
MODE

i
mpor
tst
ati
sti
cs

#s
ampl
edat
aset

dat
a1=[
12,
15,
14,
10,
18,
20,
22,
19,
14]

#modecal
cul
ati
on

pr
int
(st
ati
sti
cs.
mode(
dat
a1)
)

OUTPUT:(WRI
TETHEOUTPUTYOUGET)
4.
STANDARDDEVI
ATI
ON

i
mpor
tnumpyasnp

#Sampl
edat
a

dat
a=[
12,
15,
14,
10,
18,
20,
22,
19]

#Cal
cul
ates
tandar
ddevi
ati
on

s
td_
devi
ati
on=np.
std(
dat
a)

pr
int
(f
"St
andar
dDevi
ati
on:
{st
d_devi
ati
on}
")

OUTPUT:(WRI
TETHEOUTPUTYOUGET)

5.
VARI
ANCE

i
mpor
tnumpyasnp

#Sampl
edat
a

dat
a=[
12,
15,
14,
10,
18,
20,
22,
19]

#Cal
cul
atevar
iance

var
iance=np.
var
(dat
a)

pr
int
(f
"Var
iance:
{var
iance}
")

OUTPUT:(WRI
TETHEOUTPUTYOUGET)

You might also like