0 ratings 0% found this document useful (0 votes) 12 views 13 pages Statistics Assignment 1,2,3
The document discusses various concepts in Python programming, including variable definitions, data types, and control flow statements like loops and conditionals. It also covers data manipulation using the Pandas library and introduces statistical concepts such as hypothesis testing and distributions. Additionally, it compares different types of data visualizations, including bar charts and histograms.
AI-enhanced title and description
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here .
Available Formats
Download as PDF or read online on Scribd
Go to previous items Go to next items
Ass ignment - 05,02,08
Nene. Fivoj
Cnvolinnant No - Tch2gégolo
Counge ~ Steditsttes uring Ramd python
Comse Code~ DOgu0s
Submitted To: Submitted hy
Ug vasen Vodou Firoy
or
@ scanned with OKEN Scannerp Detine vasiiable in python with cxample 2
yy A vesiable in Pyifon is a Container fos Bloating data values
© unlike other Jonguage » Pyttion cloes not viequire explicit
declaration
Evample =
mpc t=10 # dintegex
Qs “Helle” Souing
= 3$4 # float
Point (nw. y,2)
| Diggerentadion blo a beat tuple
[ Fecdune list Tple
rvoda bitty Mutable Coan change) Trmutable (canret change)
Syria | C1 CSquene bovcketa) ©) (Panenthe sex)
ferposmince | Slower cu te reulability Caster clu to remmedeailty.
+
Exowmpls | my that = (423 My- tuple = C4, 2.8)
) explain dhe digg dle break» Continue . and pars with examplr
Boe beeak t gytag the Loop
' f
Conbinu Skipe the C unmet Meoalfon and mousy
* fos: peey retin othe next,
JQ jhace. holder toe guwu Code
Exarn ple —
1
@ scanned with OKEN Scanner- os
fox 1 fn senge C6)
Tp fis ast
bork 4 Stops Soop af 3
Pout (1)
fox J ty mange C6)¢
(Eta 2s
Continue +f Skipy 2
Pont (4)
fox f th stange Cd
fhod= = ot
Pars # Does reting
fudnt Ca)
© Pepine global vaninbfs fh pYtten with an evample,
R global vortiable a vertable cleclarecl outside yo
Punction ancl accessible fnSfele ard outsiele fumedion 3
Exoumple$
X= lo BH Coba, varlable
da -wp- fandion O +
gfebac x
Y= X45
Point CO" Dastde fonction.” %)
my Cunction 0)
Raid C“oubstde function t 4%)
© Explain Operas tm R with exarnples,
Bporators Tr Rone used ds pergorm opertdions on
Vorifebles anc valurs,
Types Sf Operations,
@ scanned with OKEN Scanner: a Apahmradic ORMNATOTE 6 4>r- IR, Trofeo,
4 dé-le
be
Sum date
Print CSum)# opfis
@ Relosronal oparators- dod,ee bs or res
Print Clo>s) HTM
@ Logical ogavators ! 4it,]
Print CrRUE 4 FALSE) # FPLcE
© Pssiqnmme nt Openatoré Me fe cee
4-20
@ Explain Rand menton Too leu fontures OF &
a Stable l
fr Rika Programming Lamguage used fe
Computmg amd data visuallizaston-
ay Fsaune-
© statis Heal Compusting : Support Stat » ORosadions Uke
cluster 1 and hypother's toting.
Provicles barnes Li lee gg elor> for
vregresston 0
@ deta vigualrgodion”
high - quali Fy graphics:
je plain Wwe diff b\w fpelse Cyamd switchO Fur
Gyen
e Ceonditon jiu Pelee yt
thon tin @
worlss Ule an if-else
Re PE els
: eee pei ) Canet sCare aye? Wesis _
guaiich Cars tr other Language’
ene eof else X73> ” Grsatian ") ' Stila")
ppt [result ) #0 Parson
OO ee se dich coheice, 1a" wppelt. “b=
Nc hear 4
On'nt ee > op — Gorrana
@ scanned with OKEN Scanner() How do you check, Ake dada tyte. of @ variable Pn R? Ga
enamp le Oy
Ay fn Ry you can chsch dhe datatype wring the Clay ¢y
Fanthen ye-le
Print Codamy (ry) Hof p 2 "Aumeric™
Ye-"Hulo”
Prot Cobans Ly)) at ole © “Chsrachen *
2A — Define Ramdas “List Hooley (sodunss OF the Pandas
Lebnany «
fx Pandan is Gn oom sounte Python Ubrany wned Fe
dota mamipulation a ama ya's - FA Prooide high -
gore data Stauctorws Mee Seviey
P fon fosmamce. , €or
2 and Data Mame : praleing exgandatfor handling
Stnuctuud Data
Two ley features OF Pomclar.
@ RMoribte clata structures + andar offen Sanieg (1D lab
and Data Mame (20 doble - Life. tuuetue Mh
amay +
nl puteds dota:
Pl eary fostons and mont
@ forann Fal: Doda mamipuloson © PY Supports opmatins
Telea. Fi Litoning 1GHoupeng manging j Me shepng. amd
handing missing dota eftrently:
2B Soeploun toe Prmany data shurtues tf Pomdar ?
Erploomn wesh enample >
™ Sanies Ct) HataStucsure )
+P Sanies % @ 1D labled amay shat tan hold any
dota +ypo C integers y Cloods 1 Stings /ete)
@ scanned with OKEN Scanneroft hes NO CEN MAES CORFU Osta
valu
a
“and to :
19 pording
Yenport Pandan ay i
data = PASert08 CEI) 36,30, 405, Undone fe" bt as
'd'D rib ts tel,
Prot Cdatay
ole
lo
20
Zo
Yo
ely ne s Pot 64
Foes
§ data Frame (2D Data structuw)
A Datafname fs atwe-Bim table Ulte stauc hunetoish
yous And Columns:
{4 Congixts OF Mubiple Sanien com
dota= §
binsd to gedhan.
"Name: L "Alice's "Bob", "Charlie",
"Oge’ 3 Lov,30359,
"Salany": [ seeee » 60009, F200
Q
df = Pd: Data Faame(dota )
Print (AF)
Norns, Solany
0 ne Ditce Is Foros
Bob So Goooe
: chorlre 35 Fo000
@
@ scanned with OKEN Scannerx
wrt
wan R Progra rn te Find the Of all evs |
Crem Ito lee unig a loop?
Sum eum <-?
For Cf to 80907?
Sum-eun Z- Sune
Print C Sum-ewsn ) a ore 2550
OO write an R poogeam yorsadacsy File, and les play
Fist sin 0008-
dod, ¢- wad CSU ¢
dat File path
“Jata-csu") # Replace "si
with ac
Print ( bod Cota) ) Draplacps First 6 rows
@ scanned with OKEN ScannerA Sstgnmend- 92
write the three types of bay charts used fq alata
VisvalPg ation ?
0b) Yor te .
vertical Bay chart: re also known as column chart,
Anis £5 the most common type, where,
bors Stand Vertfeally and the length of each bar ye preseabs
5 hee YAWVE of a cateqare .
Weontal Gay chart © Tt Ps stmilay to vertical chart bus
the bar ave placed hovigonkally.
2 Each toaw th Stacked
& whole , with lifes
the bar yeprey 7
of that cohole ening. the emegen
3
Stacked Gay chayt: chort ye pres
ye presens,
enk Segrnenks cofthi'n
ens oF Sub -cakeqoriey
nb Invite the olffF bluo a histogiam and a bay chayt?
“Par. A histogram yfsvally reprdsenks the adfcributten of
contindous data, while a Loy chart compares aliccreake,
of cakegorial data
3.4 Implomenk a Scaktey plot fn python using a Strole,
7 daka Sek 2 Dale
AO® scabver plot of Segal length Us Sepal width.
oO.
Uy 46 yg So S2SH SE
@ scanned with OKEN Scannerie |
Ps \be efffectveness of a O@ ae crechceg. OMEali,
@4 whab fs io 7
= " o8S0 Ney Cov pares“ the liftribubion of Year cdaka to gq
visoalls 5 S
A ‘ Kinag. TL easy to
aa re eovettcat novmal Afeteibuls? moana, 5
ree Lity .
Pelenrity alevtars en fren” norrnaltlyy i
> i oi SSO) Normals
5 write atcey chaacrevistte of bfoomfas., PI al? |
e2 ‘ Jnornial Disribublon y- 6 Fed umber of fodevenders, te
Ans: Bino “Each trial has only 490 passiL
Catromen
ee eee of Svcess yemains canstank
PY each
for ex:- The Probability oF geteing exactty 3 bead snc cat
lip’s ro
oF ods MY Se FUP has 05 Chante of
: 5 ©
> Poisson di stevoukion:- - models the Provability of a covtate
nomber of events occortag iste 4
ffxed Paterval of a time or space,
Events occur independently and ak a Consta nk avg
. ona °
~The probability of an event 6cevréng @o gyal interval,
Bs he Same yegulay of where thet Patervadbs (% 1 oceade|
at c ent omuriny oreack ,
forex. The probability ef an ev f “AS emai
es given hou, ?f the aug rake’ PS ernafls Gey buen
Normat Diste/bution:
* Conk’nvous ‘dake
*Sgrmetrfcal belt-Shaper Curve,
“Mean, roedgan
“The Stondare} deviakis
a . 4
Width of the Cuwe nietertng :
for ene The oléstibulion of human lef ks where the @
o
heft es apPrimakeley &'y he) dpe Stonclord det
mo
O$ A calh contre ~recet Bou
ASsomrq a Por sson clfshi Luklon, oe Per | r
Yecefoting exactly 9 calls &1 an houy 9 PYOLabitity
ey a
a fog. call§ per hoy, A-s
Yombeys of Coubls Keg
& modes ave all
@ scanned with OKEN Scannerxe
P(kek) a ae
)
& = 2.1428
Sd= loses
eS 2 9-006F379
OY = 2b 288O
prea) = SE
91
— [gars 9.006 7379
Bb 2880
= iasau
Be2e80
[6.03626 Ans
@ scanned with OKEN ScannerAsstyoment 0%
YOO Ae Chee Sw sant ov qondvseb of 4p?
32 TEX datemton ho wl 0 Arvemodtol yo aig
Adribudton Ordchar Ana diarived dighkbubfon ef 0 “ow
“Sa hugothate Ads Used Ae cect ay An aoavrevd dato,
%e “gped songh” +o Sugapt aio Be Cows. A tor a. qoyu dalton
wit o Sadie diststbuttor
») Waits Aha Comparison of thr assunpatons oh Zak Ds
Populosion Proporekou Row dee Rquorws. gett o ie
Auk?
uM PZ sak Aer popubriion -
RuRQOHATS arenes Ta gapuletton qorjortion % Sysiftotly
BMorovee fiom a \ypottr ized vols,
+ Whe Type Nurseted, /Spucdffeely s proporsior -
> Ui Souown Goodvand oh fk Trudie
*Raporsr Te detronine Ul cbisevd Cobagorical dato davight
sta anroakical distribuiion
: Veto ged Cobsgovicd data hier Oviswvefiouk or quouptd.
Sorat (osgovina (a. Cofboxs , type o =
Ord once eo de Beh panwes Lopttaton a One Damphe £orve
Domes Adank 9
CA, Ow. Bangle Teper
+ MsQosss- Dehorsvcdar A AML enon aN a dle Somgls a
Sipe feowthy dihlrarst (5am a Spcilic Nols,
@ scanned with OKEN Scanner+ Soueple s+ Tad? 4, Aa atv rede 4 ° A) Soadectg 5, a
a GPorvtiu lar ae wr Sqvfice: Say airs Aron
M2 national usta Wight.
A Two Ansage Teast 3)
+ Compara A vatowa wf too Gudaprndere Sompha Bere,
Porwad Snoaples
Prowler Com Qarster Ate Surat Ravollusd of WAU Gud Wornsn
Aw a lthy, 0% GuPavivg the bflned Pmnures oA Hokineyy |
‘ores amd after Ra Madicodfor.
Qs) Skeabe Ae yomnulo ders passa Aa Poplakton
protoakee) ‘i 7 a
- “Ths Arik Stedtette fox Wypothusle Laing, oA a goqulio,
“ qreoponston Ussx a 2- wo and Coltuledad oat-
z= (*-9)] Sqek (plod).
AS) toned A Ake loude Sade sical wy A Bavikfewes
Anita, ashadteng me On ciated na peta Li
sah ond p- ro
| DY 0 wthiggaasas.
[
@ scanned with OKEN Scanner4
4 Stake the formula for hypothests testing of Popala\y,,
es , d
Proper tion 9 .
yns The best statistic for hy Poth eats Aorta
1 of
¢
Population PYOPerton USES a 2- Score ano\
Caloulates, Oi: 3. CP-P)] sort (PU -AX ))
* hak ts the CONCPE of glatisnbal
°
‘oclveliag ral t atternahie }
levels o%o) p-vatves
D Nov hy posheste:.
© hy pothests testy
SPOS sfriitanee
Lt fs & statement of no effect
affect oy no clifference te
A Ssompbion that yesearches atm to elusy>:
Ena draq trol the roll hypothests night be thet the
new dvag. no effect on the condition betng Yeates)
Alternattue Vypotests:- Le Is a s\atement
oy a5
"S the loseustt
aren.
Mnak contradicts
Me ayu hy pothests. this Ube Wy por
that vesearches Want to SvpPort
G@ntafatng he Aug Weal example, the altey
Might be but MheE new dwg cloes have
we" Gna ition
} Styrfffeance tevebs Le
See
ypeke
Gn ethes
“Tt ts typteally Seta 9 oS lor sy
threshad for s
Fe ve present
Veect*h,
Actoaly. tre ng. the n
> P walver,
&
tabrstteed SQni flea ne
a Propertstity oP
Mon
ell hypothests w
hen recy
Tk ie the Peokalaitity. of obtatata Pesurls
enced Sf lreme Sy oa ere enc om Poe
« wesuLly Assoming Che nell hypo thong os)
me P-value o 7
stg bie eS less thay oy
equal y5
ance Level he noth hypoth ean, & ae
aed,
@ scanned with OKEN Scanner