0 ratings0% found this document useful (0 votes) 174 views33 pages Dav Assignment
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
INDRAPRASTHA COLLEGE FOR WOMEN
UNIVERSITY OF DELHI
DEPARTMENT OF COMPUTER SCIENCE
ACADEMIC YEAR 2023 — 2024
SEMESTER - V
ASSIGNMENT
DATA ANALYSIS AND VISUALIZATION
[Full Name: DURGESH CHOUDHARY
| College Roll Number: o( Yess 1s
| Examination Roll Number: PjIOg 7 S47 00( 2.
Date of SubmissionName : Durgesh choudhary
Roline s tes /i3
Sem
A Vitualtecctinn AAs
Data Analys nN rment
Subject =
PAR Toit
a Lit 6) Statngs
Gren the followin aes re
LREL = (Guod Horning! Good Evening”, Helle , Jeoot
ARC mavn', ‘queetings”, ‘Good Mominy ‘or
Perform the follansing operations
(Q) Use Ket Comprehension fo Short vojue Strings vith
mult’ wads 6) ‘Uist 1’ to Another list Tamed ‘Maulist
Ase watte an~ anenymovs function *# Sost the given
Imt “Listt’ on He last —chasacter each String.
As Ajenitst = ot (fs foe S In Litt if lenCe.sp+())>4)
Jn this ,T vsed Set Grnprchension fo shye ontque 7
Steings .
Anonymovs function + UskL . Sost (key = lambda s S[- 3)
(b) Using 'lst1! generate the folleuting dictionary “Anudict’
BED Ke is the = Sunt § wordy in a stating and value
ts the [ist 5) stings having that Count .
Any dict = , 1: [' Greetings 1 Hello “J, 2 ; IE eel Feetos 4
Borde sas selene iste aL Nice to see en
Cueate - ota Senex Det Using the created Dictina
Anyeltet’. ass
ans Anydtet = £7
oe dee Sriltetedes
Lord count =len Capt tem. Spltt() )
f Woad count not In Anydict:
Angdict [ond count] el)
Anydb ed count) -append em)
Cant (Any det)
import panda, 4 pd
Aryatet = C1 ACS etetingr’ ‘hella’ ] 2 [ Great Merntng ,- J
Bal NKR to See yu 7) a
abet - pct. Sc soc brydict )
Print ( Pst)
(©) Deaw a bay plot te compare +the frepeen Strings
with equal Lsord Gusts in ‘Listd “ Pow “example the
; bh Hh 2 eeods fh the given (cst
freuen J Sys Oe Witter’ yer
‘cete™ 4 Clue paspee — narnes > axes.
Fo pert mectploHh .pyplor os ple
Lit = [\Guool Meaning’, Guvel Euening ee J
werel_eount_freq = C3
Re tren Ty cht
brood cunt Be = len[ tem - cpltO
Te toed Gannuben ceredneren iad ws 4
tend _Count rey [_ toed _ Sunt) + =
Rises
“esd sunt Poy [nes _soust) =1
Bead _Guntss [st (ood _ cunt. freq + Rey #0)
Rey = Wop Card aust Poesy ? asec)
pit. baw Cored -sunts | foo |
plt -Xlabel @ Load Grint /
pit. Ylaber C 'Prequenc,!) ;
pie tLe C Fecquencs a Shiings WHL Equal Word Gunts »
pit. show ()
& . EXERCISE +o ansuer
Consider the fellouing Detafoame Z :
Pee 2 given questions eee ‘Rind’ acttaTbecte indtcaten
the type 5) erexcise eC sim ce followed |
ID ame | Dret | Plce ieee, T Kind —
A tow fat RS Balen
A Tse fat | 851 Sale
e. ho far | 8 ee
a po fas” sede Walling
6 no fat T >, a
S [Teo far (94 ee cea
= fev tak | 9 ao cart
ce Too far [93 a
5 low r ay a axes Sigil2 re |
| | = teat |
pees mnning |
pS SG | iva faerie IAS mining pe
@) Create & new DetaFsame SELECTED having a
diierarchicol {ndex on Columna>Nacmelancl vSie-ee anon
Rind the max pulse vate for each ndivdual in see
Selected DataFrame - '
ans Tmpext pandas as pd TS ee
SELECTED = pas Date Feamne (EXERCISE ). set_foder( C Wemne’
‘pret’ J f
maxipulse + SELECTED. 3rupby('Name’)[ "Pulse Rate Jjval)
Paint (sécected)
prot (max_pube )
cb) Gount the Pal me records 8 individual ea names
‘a! 6s 'B’ and WKS at Cllewing @ lov fot + plan
frorn the dotafeame SELECTED Created Th pat (a) -
Also Seth Data Faame SELECTED om Index ot fisst leved
tn descending odes. Seas :
bys UK Ree. = cecected.toe( CL 8, '8 7, “lao fab iy
ae :)
BlCoyA Count = len( selected x cords )
Aecotr on index ot Fish level in Aescenciing oder
wlcond, = SELECTED. Sdt_inden(leuek =O, Ascenebing =
Fal
pant ( recnd_Souot) pices)
pant C #f covds )
s
c) ve Declafeame EXERCISE eate a gues a ie
: Subplats Ord save the figeae Oth name excsetee ph ey
get 4 igure an ‘EXERCISE’ , Rint Cub plot Gmpsacs
the avearye palre vate 5) Sadivdual” iendactee |
Second, Sul ploh Shinos, the ye lations slip heron
Va vie oles pure’ ~ and =) ime. 2) eee encody 9
LENS Vastable ‘Mad? fy, the scattes Plot.
OuvTPOT + 2EO
roy motpletGb. pyplot as pit
impo? pandas 9 poh
* : Sulplots
eate Pauye with 2 :
WC t et = ple. Subplohe Clee figsice = Cl2)5))
ae , ,
- tle fw Pig
yeset Ht ; ;
Sup Pla (EXERCISE , fontsine < lig)
tr Gat Cubplot > AVG pulte sete 0d) Mnolividua
ais. plse = Gaercice .govuphy C'Neme JC Pulte’). meal)
Avg—pule «plot (leind = ‘bay’, 4x = 41 , Coloy ='Styblee )
AXL. get Hie (‘Aveseye Pube serie by rh Koluad ")
AX{ . SOt_mlabLedt (' Indiwelieal ©)
axl. cetylabed (* Avg Pulie vate ’)
H SCamd CUgPlo ¥ >
Pes cles c Feet ted’, atat’: “blue UT runaing *. “Gacen 3
for Kind , Coley in Scatter_colow. thems) ; _
Subset’ = Exescece [ Exercise (‘Kind J == Kind
OK . Scatter Coubsot C 'Time(min) J, subeet [Pulse 4, lai =
Se Http Wo Re aye 2 A)
os peace re ‘enecteegot ogy Semen (| falee!)
2 pie the follacing Commands to Caeate Sestes cy
Bes ste DEEN oa ay ne
'Mpos- Pandes ca pd
Se = pd. Sesfes
aim i: t..3 J
: C*Madhcet 1) Ajey sharme |, RON Radha 5
mOEOan |) Sitio eee slanuay
toate Separate Commands 42 Cornpute the lengths eack
S09. cin the: jSen*s | replaces! Ou ele ngs
In the Serie, Count the O Replan © otk ba ae
Sv = Sx. Ste. replace Caw Z
5 my
> Count the occurrences 6) bal tr eacl, shnn 9
A cyunt = S¥. Sr, Count Co. =)
tea,
Bhanase cove S| CUR et
s ce e a wéts - \etoer C) op cy afesteUfpew C )
se eR eg
‘> Find ofl Sta a BS PE er)
poe! ANG, wre pattem adh “tn then
S ‘
Coein_adh = Sr{Lsv- Sta. orntains (‘acl’)
> Find all otetngs that @nd wrth | C7% i}
end wit i = sv sv- ste. endssth('r’)
(b) Create a dataFeame dS) t wes 2 4+ Glues
Crnteining wander tntegess tn the leage Bl ite
Iso . Cornpate the Carela ton 6) Cad ame Bl
precekiO 5 wm.
ars, tinged pan aee os ph
im POXt nen PY os NP
dp = pd. Patazame (np- Fandom
C+)
= Aes (oe)
endtint eC fof ) -2tshape
Be _ Covrelation
2 eulemetan- ecm J
wow Goxrelation
Prot Ce Comre lotion
©) Liste Numey Code
ico interes G=ane
Trdex the langest
Dene ae Ust toto, ~
a\l Kegel elements
Ae Tenpost mumey os ne
Sastre Ze np. vandsm. rand fot € Sy us Iso)
his wth generate list 8) lap inteers fn van 9@ 5) 55
+o 150.
pant C Listt)
tt To pee the index Jarqast L Smallest element
lasgest_ind® = "Nf. Axgmak Listt)
Smallest index = np. 07g min List)
a t OESS loxto motnx o& x#pla ca ald agen’
grate = np. atahape (Wistt ; (19,19)
Te Pr Avax ona’ ( matatx ‘i 1)
Pant (wert)
to generate & sander Ist
55 te 150 and Cdlentif, the
element and smatles} “element.
lox 1D matnx and pla
gee
al ele Ohh 7csc te te hata aa EI OO ae ~ =
dhe Data Feame EXRASE petded th 42
st attempt the flowing quations
a meP fusctHon 7 Ose rrap Panction fo ©
Jsing
ap ot &
5 A valueg tH SOIC?” attabute to Uppestase.
a 7n Pandas fs nel fo apply
6\ a Pandas Sezies
element -2!se Operations , Sucl_
tt frenshem cr manipulate
Col annn 5) a DateaFeame -
Con vedt all valies 8 Det?
GrEerase Lipiet’Jamap (lambds ne
%-opper C))
Fonc. 4 cmvett excl chet value fo
ap She that Lambcla fine: te
in she Diet Glumn |
(Le) Assuming the data is skeed ff, a CSV Pile“ Exesccte.
csv * se tf fon Commands + xead ths file
indexod on. ‘Nome” and “SBieE "| Sage e seen a
mamed EXERUSE . MOU, Thx Gmmard + rod
ombey Pst fee So fle. If fle cytatns
poillions atcords tin ghe the Gmmand fe
end the: file in Sma pieces ) upifrem size-
Tmprst Pandas 03 ph
2 als pa. xead_Csv (' Exercise . ay ’, inclex_Gl = [veme,
‘pree’J )
(( éxereise , av “1, wees = 8, index 6!
= (iveme 7, "Diet i)
EU tad Put & mes
at Neo red Fe In Smal pieces * onifo mm Sire
are fae esy
$4 zs ; Lars ,
Chunk _Ther = pa-2@e wav (*Execiie- sv”, index Cl = ['Meme ,
‘piet 7] chunsrrze = Chank_ ate)
Foe chante fn Chunk the lL.
Pint (clink hed O)oO Dipfesentiate between qiut And Gut methools . Use
the =pprepricte method fe Create 4 bins on tho —
‘Pulse ’ attetbute. Stee the Grr%Ponding bin value
‘Pulte ‘ atte”, a O% NO atts. ‘Phin’ fn the
Osigtnak DataFrame , DISAYY Count a valu es Jack
nS
Ans Cut ee :
t wis vesed tf Crate bins 9) t) This usec to Coeate bins
appreximeactely equal ttt: 5) approx, equal f reg uen
Cavan tile bared binning )
2) TR ensuses thet eacl
Lin Gomtauns rou hly
the Same number 5] dota
<
pants
9 Usepel when yeu sant to
Aiststbute data moge avenly
acasss Ling perpecially, when
deating wo. date phat it
net even iirel Spee
To Create 4 bins on the ‘Pulse ‘ attsthute yssex Can vie
Vqauct “ methel Sines MH Prorteley bins 4 eg
are coe
2) Divieles the eata nto Ling
besed on Specfredl bin eclper
os nuembes SJ bey.
Sears Maedal then yeu
want +o cleffe Custom bw
edlpes ox hen you neeol gual
width bLfrs
Tr 0 ost Pandas a :
af = pd. PotaFoame a Mpelhie IE #585 88,30 92,
93, 9%, 9%, 34) oo €2, 03 sige ayy
ar nla pdt. gear (AhC' rae’), 1)
prot (AR IR pein a) =i cena 0
Te ovrpt 5) above. fs ow Fillaoe > .
C4250) 5
OC 35.cPrla) 4
(C525, eee ag:
C Sis 929 2
Names Pb Atye = CoreyGh Constler the filowing ADM Gemaining dora a
“Foeshly admitted = chidents In a College dering Vastnes
prunds admission . The DecttaFeame Snsists
Stadent’s mame Cut A Ust fr psitd he (she? hey
Fateen — admiss’Gn date 5) admission | bic/ bew "la
5 masks > Curse cok ank gender .
Gurse
Name Date Admn Masts pars Gender
Amt Jasook oop wl 9+ Cov Male
6-9-0} -%l) 95 | Cor™9 | pale
04-04-vU] So | Ctr | Fewete
ol-eg-tut | 36 | cool | Femake
20-07-%2|| 96-5 | Coo | Male
N-67-Qou] IY-5 | Cwg | Male
3-og-2eu] 89 | Gbir | Female
3-0}.-2021] 9 - BW | Copy | Male
ses fe
OG | Female
bio} - 224] 88-5) CUD | Male |
Poad eep Dubey
inky A Bev
Son a shal
Sushel Megy
J
Neeraj Gauw
Prect’ Shaame
S8 | Deep Gupta
S93 | Pxtya Bansal Jo~ 0}F2221
FAIR Alea] a] apa} &
{ele Anand Rhuja
Pesform the Blloving
a) Sh the firt Glumn ‘Grol “as the mmo index J the
sien DertaFeame ADM . Create & pivet table the
DotaFrame + ee the Fete no. J admi sion”
Pex "Course Code” and ‘ Gender '
ingot pondes oo pt
ADM. Set_ index ( ° td " Snplace = Tre ‘
Rot table. = ADM, phot table (‘nae = * Cannspc Ged
"Vales ~ Name , aagfine
we
Cluny SROs
i P
count’)
fant C pivotable)(b) Foe each ‘List © find the +totaQ numbes adm ssivny
finfmum 'Masks*le ' and Maximunn * Mares 1 in
eae Coase
Ans epost pordes oo peck ae or sa
AdM .grovphy ([ Lat, Cowrte Gooka ay |
esult = Jwrp. 99 f Manne’ ‘Count “Maskas : fe A
J Senex gf ig)
sesule. Columns zi Tole prdenissions | © ' Minimum Marte”
eae . ae 2 ,
Maximum Maas |
2
pont (xesult)
W Caleulate and disp avg Masks Ye ; 3) all Femate
Students 5) Course “C12.
Am im poo Péndas as pa ¥ ‘ NQ
Female Ci? = ADM[ ApM {Gender |= ="Pemate J&
CADM C' Gurse Gola) ete ales ey)
Avg marly = femate <1t2{) "Mayks cae mean C) ‘
gent (' Avy Mavs ) all Fenel Shelemts f Gune C12,
avg mars
lata Sest
QF a Give Pandas Statements fo create 2d ee 5
zandamn floating - potnt mumbess Wheat fias ata
Series fax a datetime Index al Secand Tuesdays
8) even monty 202 and tha Se%nd clata Sestea
fos 9 datetime thdex 20 Gntinects dates
ending ot 31/7 0l/ wai ~
pos, Tmpott pandas as ph
AE Generate datetime tnolex fy oth ond Tuesdays Jevery
ment. th or :
dote_inge = pd. date ran 9 (stent = ‘aan i lo aeerd ="sou ee
3, fre Twom -2TE | )
Fin t Sevier = pd. Senies (np.reindon randa( len (date onge)),
index = date »nge
rnb (fin Series)Pals eC ne ERC reg Loe 1 ERNE IOS 20 oY TET ea econ) a
BLN L021 \ Poon
an Onad ='WUN-O1-% peded. 2
date mge = pd. dotesange ( ne ! Vs - ae
Seema _veres = pol Sesies (np. rarclewa. 24nd n (10), inden a dote >")
Pant ( seamd_ Seyies )
Ub) What fs xeaams Lng 9 write python Code dapictiny
the vseye 5) resample method ,
PS Pandas pevicles the “atsam—le metho for acsem palin
Brae Series data. The atampla methed fs ty pheag
used on & DetaFeame Wi a Datetime Index 5
Perfom ae an UNS) epeentons .
Exarnple 2) Res arn ela Meth sew
impost Pardes ay pt
Tmpogt Cote aA ne
tb Creating Sarnpla time Seales with daily Fecarene
date_ vanget s ed date _sange (Stat =* 102! - 6 6 end =
‘ Q021- Ol-lo’, fra ty)
MP. Asange Ce) ¥
> el ate 82 9¢< )
data = yale ‘
df = pd. DotaFrame (data “cnatex
Ab resample data ty & monthly foes, CAEN ren
5) Values ie
mantle nearne= Af. 2Ery plo CN ) -meanC |
PRL CS Omiginal dataficmne >”, df
ant (“Mow K2scrq oled rood
se reo oe oT
This Method alla te chanye fos S\ time Sone,
Aka anh afrs~ vexios ST IrPation operations
Wee Sum, mean ete. cli stny aaenging proeke.
CC) Comte co df BS we 2 Clumnr ‘Dates 4 'sale ”
Ontedinin oD cloten, Janus rm & 2] wind
Tneesers “Le Soo S loo wae. Mad another columa
“Moving Avy’ to DS Cmteining the willing avg JPE Centecutive Values in the ‘Bet Sale’ Glumn
flob Simpl Woe plots blo pate | £ ' sales’
as well ag ‘pater’ & “Mo Ung Avg “. Explain Pe
utility Y) the wiliag method SH sepect to
thee plots
Rot Trepor? pandas a ro
ty po? numpy oa ne
impost matplotlth -pyplot % ple
MH Genesating dates fry January Vor
datesng = pal. date _wange (star = "2621-01-01, end <
\ne2!- 01-31, Foe, ~ SD)
ak Genews ting 3) vandorn int. ble Soo A low be ‘Sale,’
Sale_deeta, = nP- MOdom , randint (50, low~/, Size =
lew ( dete_ =9))
He Creating BataPrame DS
ae ‘ Oe ‘Sate’: Sale_
DS = pa dedatrame (f Dates’: datemag , 9M 4 &
be Caleulating willing avy SN 5 Grsecutve value ta
‘Sale! — Colum
) j ;
(eas. 17 = pe [i 'sale /)-alling (window = 5).
pg [Meving Avg 1] : i : 3) See
tr plot Hine fox | bate & ‘sate , ‘pote ‘& *
pit Figure cy = (iz, ¢)) ae
pit. plot CPSC Dates ”) , Bs (sate J label ='Sote ,
m9 Ske aay
pir-plot (DS [dere] Bs [' Modng Avy’ J Webel = “Mowing &y
(S-clay\’ , martes = es
Moving Avg /
plb.wlahel (‘Dates !
gle ylabel C Vale") ;
me ph (sale, Pete & B-day Mewng Aversge a
Pe. Wticls Creation =45) 4p wotabe x cute (abel
| git. shoe O bette. foeske Gt UtPolling Avy ts por Heulexty weful Arr smor
mt fluctiations os Roise inh tHme Sexier dare
allawing 40 Telentify underlying tetnc & psttexns
easily . Te Ean be eipectes Le Valuable then
~y Branctal or Saley docta cUShege shy
" Plictuation, ere Gane o
PART-~2
BL ew Ge output 5 Folleotn 9 Coie ao
a ten post panda, ay
3 = pt. Sexies CO we", \gupet 'goeae’ J InelOx =
oy 20)
B58 - inden (sange (6), method = “eft” )
53
— oy 3 Sent fs yeindexed ancl fmoark - Aied &
Fu the gaps fr the fnclen sange farn Of §
The outpu tt Wow
woo
oe
geod
great
ae
dtype > shyect
inci): ee 20)
Ui) mectara = [_[y fox j in vange(8) J for Pin range ¢3)'\
Pont Crate
Acs Tt gene yetes 3X 3 rncetax using hesteck Ust
Comprehenston +» \f! fine evey Glumn ana eh
for every mio. WwHputs “
CCo, 1225
Kip: Fx, 2) ;
[043 2) )
diy tm pot Pandas
aren ee mel Ce uid, Cann Ui elseTratex =[\ome’, ‘hee’, “theee , Pow _) , Slemas =
ivay CA 8 C7, meee Sorel
Gie output fow af-plot. bar () j :
ms < Axes © 2
2.00
14s
1.50
1.25
1-00
O.F5
6.50
o
© -00
\b) hat Ts O prot Fable 9 Grve ore example
ans. Pivot table; fs a, date” processing techahuc we A
in spreadsheet software and data anatynt tools
Suck os RiorosoPt Excel 4 Geogle Sheets and Pandas
Tr fy thon - Tt Allaws fo Simmanrte » 299 ep ote *
2 organize tabular dete fnto mex stauct sel
and Consctse Pormat , Mating tb Coater t analyze
and dead insights from +he dota .-
Sn Pivet table , have Polleatn y Gmponents 2
fros > Repent Cxetestor by UFel we want +o pp
TA Summanze the dota.
Colurms . mepresent Vastables we want to analyre
Value, + sepresent dot® Le want ft apg yet] fuel.
a Os Sun Count , AVA sape ec.
”
Example « Sales Pada Set wit following Glumns >
“poste, * Product’ ‘Salar’ & ‘Repton’
fivet table 40 Cummasice fetal scale, for each protuct
Se Coc Region |Proctuct | Sales Repicy |
A | ape A Were |
a tso Soucy
a Qe Not l
2023-01-04 S wa bag
2023 -S6[-e S 8 ed Re
fivet table ee Rls 6 Pepto
Values 1‘ Sales‘ (sum)
Sales ah Total Sale, fe ead
Proluct Reg fon fombinediow 6) | Pavuct’ &
A Nowml. 300 {Region ‘ yroalting i
e Sooty 330 Cases to analy ze Sales |
c west ee
(CO) Pasyide output :
Cytuen values Stefiag Shject S = 2-IN5E and C=
This is a (omy Stang that Spans multi ple (nes *”
) val = flootG)
kype (fret )
ane Seles * float >
wy bods)
ans True
i +C\n ae
oe rae Pee J pewline Characters (Wn!)
in ANY Cc. Qetput
a
xs Lynte
gg) Consider a list Sop = eco 5, ele
a Code to find Sum 5) elemonts 4 valucs HIN
ehenmens S-poe Sey = Cyt) 9, ts, 5,21)
ae Bnd™y Sum S| Valuer up te the Clement 5S
Sum uontS = Sun ( Seq [: 6} ) P
phot (Sim i) Sum until
(2) Gnstter the given ave = ( 1,2,%,9,3,4,5/0,6).
Uthat elt be the wuulting acs ce these
opesations ast performed esas (6:-1),
and ce t: aes ‘
Ans > avr [ 2 rie) Sasliees Sane ns sae fas fnd& 2 to
incex G , Fulting array = (S528)
«aay [-5 a -1) = slices the amseay fron ST element
from the ent fo 1't element from trol
ces = s/w esy 8)
s axe [ Z 2) 3 slices aw witty & Step j2 , th Sekets
eu Second element Stesting Pare
Beginnings Ku end
fault = £ 6,3, 4 to ||
fp Comte oo Rade Peamye aac tien a aie and 3% Glumns
and pepulare te with sandem values Intex
wees an” otal.’ ohis? ,* Texoa 022g “and
Chinn aera oe Naas ‘eo conifer enlace ares
fare. to Gempute the diff. Ho max each min 3)
eady Column «
ps Tm po 6 pendos oy pk
,
Impose numpy np
data = np.randem - rand (4,3 —e
AF = pd. Data Fedime (dara, Colunnns he yas a
Teter = ['utah’ ohio’, ‘Taos “© aero oe
ae tome lambda Func -aiff = re ae > Gl.maxQ = Gl.mmy
Colurnn _ s
aiff. fanc_spply = - apply Ctolumn dette )
ee eetiac ce dectaframe &£ column diffesenes
fEnt C af )
pint (4 6 _ func ery )
(9) Ceeate an & mum S| size 2X3 Plled ot all
Zevoe, | then Msers Gionsale £1, 3.6J] to ora,
Tolentify shope 5) arsey hum.
Aes tm pot mumpy 4 HP
dE Create 2X G Billed wth zener
pum 5 TPP. Zexwrs (cae 3))
4 Insexe Value Tate nan
value, = mP- axreg(( C128) (O17) «])) L
num = Wp. copy Cvatier )
Ae Tdleni Py the Shape 5) num
shape = mum. shape
past Gay)
pant C chape )
(by Oste a Sele te seach
Beliindes SOS palianes
ArS Tmpe ol«
Se oro as pA 2h ares
Af = pd- xeact a tle. Gu, SPS Yaa ,
Bone)
a csv Ale wrth neo
\
line tesmineter aan |
pant (44)
Lip Genser Flimeng piece 5 Gols RB
bao pend ans a
a = pd- PedaFoame ¢ £ Mrs Ct, 95189, wal
Fie! ‘Ll Sel tail ee
give output »= ;; a.
b= pd-PataFrame( {lit ?: [4 lo,!2 13,7],
Suni! PMeie <2 bar param ;
= Sel yh vole a eam
C= pamerge (9, bom = 'fh’) how = ‘ng lt’)
ct) -Hsvo many ‘Nan’ Value, ast Fy the Pata Frame ‘e'9
AM Mesged DataFoame - *
fd Vala valy Total Nal values + 4
r
° I aw
\ 3 Nav %
2 lo A vo
2 (2 Nan S
y (3 Man t
S + Man w
Cin Dep Aupcate value, form datafsane ‘b ant
keep the lost duplleatecdl value . Aha
ADS bd duplieaty (subseh = C cl: 2 a Soa ed
: inplace 2 Txe )
(D) Generate Porte Time Index 5) lengtl 2e isher acl
Fnolew wilt Le Toes doy 5) te thisd moet Sines
Saxns Pron los Jan %w22 .
Impot pandas as pd
\
AE Define start date
Start_ date = 2am te :
tt cote wange J dota with o freq 6) 3° Tuts J month
Mie vibe = pa ote eas (siaxt = Stavt_decte , pened =
ww , fox ='WOM - 3TLE )
,
Pant( date _»n9e )
CF The sutin PatoTimedndex will Comfertn Lo date cack
" wepmenting thied Tuesdey 4) marth , Starting fom
lo- Tan- 202 2)
(LD Gnitder pasta Feame af
Tmpot. parde, 8 pk
Ten pote numpy oo 0 a ;
Af = PA- Data Poame (¥ "Kees r [‘o ibe. C i) a , value J5 mp.avange (12.0) 4 )
What lll be adpat oJ] fe lowi Stecte:
| oe ek ane 5 J ing cube en ts ?
ie Fey Value
oO x B.e
\ b a)
2 S 2:0
3 a 30
y u 4.0
5 G 5.0
7 a co
7 4 +0
= - £.0
3) x 3-0
RS b loo
) oo 1.0
GW) brte @olo + arr dataeame using key 4
Ani grxped = df. garwphy (Sy )
Sumk= Javoped [\ value] -SumC)
Paint (Same )
k
a B-o
b 22.0
© 26-0
hame; Value, dtype ' Plot $4
i? Mulhply eal. gmop value by 2
Aes af [* value } = Jxrvpeck Pivatue']. fran cform (
lands were ots
ae
3 key value
6 a ov
J i De
2 c 4.0
3 a ee
4 L B10
5 e 10,0
é Q toy, S
> b hs
& ¢ 16.0
o t °
fo, MCs ye
Ma ig:»_
ye 28 gaajGonsiMes datafoame _ elf oo Po
- e tempest pandas as pt . eae
_ impos numpy % AP
nee pts Dara momo Cf hey [87's ee
> ke ‘ !
ae Ses 2': F ‘onet. ‘hie’ shone _j two) ene a
» a Maaee _np- Bandon = Fala (5), "dada 2/2 np.
Roth adpat fies felling , :
ta pint (AP)
As ket Fey 2 Datat Dated
> ° a bie =25}%6 = 0.3 $0395
e ' é & two 1-S5S7626 0.08128
4 2 b one -O.29RD ©-$Yo4S3
3 bk two L.4ggalg = 2-44 5299
a x one 0 .4F 3301 0-089 €
J
@ mt = aaa) gry CEST, ART)
: i. e
pent (mt
eos Ke, 1 ke, 2
& & ona. =O-8Y 206k
© two }. 553520
b one —0-341 224
. +two 1-463 042
eo
Name AAT ctype + flea toy
ae a Valu A Feye Values _Gesvpek _ mbm
Mean 3) doted fy each Gmbinatton ) fay! 4 ke
s culated 2 Aisploaged .
oo
= Gy m2- Af (* dota |) ~ 9 CaP Dp
‘ead s& -0.042lo
B 0. 54g
dated Glumn qrvepedk Be
_ ily pieces = Ant (ISE (AP grvpby (key! J)
eiaaana
Pieces Jaals fi\
pees kee, 2 keyed datat deda L
2 Bo me 0.8121 et e4s9
as b too LYS30(2 2-4 65235
(3 WSs sesule pieces [ib ) ewtath: mres Shee «
bey 4 ts equal to ‘bh’ . Inchuocley both [ke,o
detat , deta 2 column fr 'b' 9 vp ) of
@:
2 fos (kL oer g ©
AR. jroopby([ teeyd”, Mey? J) ie
Park et, £23) pe
ae pant (920)
“hess ER prints the’ Fey Ck, 2) and Gwespending @
RSE eC eer eo
Te _love_ftresates thoroofk each untiue GSmbination
ae) Meey! AS keg z? values. Output = a
Ca ee ail
kay dt eye Aodaq — clotag e
oO —2ANBHIC -0.35039S
x eeGF eT] F038 WIE
Tae ese
[- 56526 oe FPO I2ya er
2) =O AMD) AVP F SIRS 1 Pea
dloted date
te W DSR Ss d= RCSA
©) Gre output 4) follwing Gola Testify
or
a Ve ES 2 i
be mart che f [Sinz pee
a Micros pt ” Z
Osing Lxtt generote fpllerotng “Asc Henar
Anghict Short key {Ste unk J borda Ih
Staing ard value ts othe ust shang
@ Fading hot Grunt . Any click =f 4%. [Anam
int (veR
Dan Pf 2 (5,4) ) : 7
O = Hird clement 9 (ist Vok7 fas been
we Changed tro a tuple Comatning 5&1 values.
ae =n02, 55 (4,5)) »
~~ Vas [i] = ‘two
2 pant (vas ) ‘
a Type Eswor - tuple ohyect hom not Seppo Mem
asscgnment
MP Taples Note _Wncotal aah nea oe rae
Des CRewents Gmnot 4 Changed one they
e me ated -
2
e Giver sfolleoin a Vist 4 Sting 4 ey,
— bast = [a Amana Cun aein Agere “App -
©‘ Miorerof >” mapa is geek fre heat’ St uke _
®
eo
eo
eBai
é eh ae
"Prnazen Amaumn |
[Apple is gol foe
Tamaum bamating amaze —- oe
_ ep Gaunt = lambda S 2 Pen (8: SplLU )
__Pryolict = 2 j
Re shtha fh Gstt
Gunt = terd Gust (sting)
tf _Gunt fa Anyolfct > 74 E
Any ASAT Cunt |- appencl (ching
Z yy
_ chee =
«
Bnyh ict (cunt = (string ]
_ pnt (Anplict )
(b) bate Gole t sead dota fron @v Gile . Fra ©
~ 5) ws 2 Glumns fn docta__, eplace missin
Yolues will. Zero 2 rxemore AupCarte Value. oF
bxste the meodifel data back 4o aipinak fil @
RD Foot Pandes ee poh
af a pad = stad _ csv (‘deda. csv fo
veaaearieas
Rnding ne SJ) wes L Glamns
Rum_ anos num Zolumns = Af. shape
pak Fe Rurler J) Rows : Smumonns | 7 |
pant CF Number JG lamas £ num aNeeee Seo)
AE Rela Missing Value” wth Zeros
“af. Filing (©, ingle = Tae)
FE Prog Pup\t cates
AF drop dnctcate (Tnplace = Tre )
RE Pedified databace fv
9300992 (9|'39 2
|
|
|
|
=FPe
migino tga
SpinalDate
yon cv (Ate civ 7, tnelen = Fobse J
BL (ay what & the use S} Generotvs Cunction J _
sve a Jenesets furctinc te print Square
fost on mtu numbers Shere _ nis Wer in
BAS Genreatye furetion in Pq then ts ated fo
Jenesate A Sequence J value an the fly ons ee
a Ame witht SBring eo Ante Geguanc
EIT - Tbs weful Bren Tneeal fo work with
lacqe PAPinte Suences oj deta, oithack
Consuming excessive memory . Key woad = Yl
cof Square. of _matiealno(m) ¢
Count ae
Wake Gaunt == NOt
Yieho Grunt * Count
Gaxin tamales
jE Pore wes fs value “n .
™ = tot (inp ut ("Enter veliun J] nn aa}t)
Fonesctvs a Guat j= natiralno (~*~ ) aoe
Per Squaxe bn gentsator 2 , Be
pact (quart \ Sbjct _cacatect vsin g
EZ, Jenesetyy fenckign..
a a ied a a | Fae
PD Ure a Coda pryan b cya Seater plot
° Com paving enacts Gf Mast Mothematia = ( &¢, J2,&
@ §5 Iso, %, So, Teo, ena and Sterne >
e 35. FSS hoe ae eee eae IS Qo wo] Subjects.
: Tapas necessary (brass fe a
ae the “pet ox * Nawks Gmpavion 2 and labeQ
Oy ae oy Natt Stored”
-Date ... we
__Asslsmn sed lov i methematt es marly ~ ote
Aw blue Goloy te Sclence mi Aes pants .
Ry impos} matpletlb. Py plet as plt _
FF Marks deta fee Mathematts 4 Scencs.
mothe =[ se Br 60 Sr $3 So tw, FH 34
Science =(85) $5.49 48 j loo B32 15 te ade
Mmarks_yange = [lo, ®, 36,40 “Se, 60, 9 fe Io ee
Satte~ Plo Bre Maths
pit scattes (mathe, Stree | C= ¥ a
pit - srtter (martes range , mathe , label = "Mert. Marts @
AE Satter Plot Rs Stlence
pit. Stattes (masks vange | Scien, Abel = Scene, fei @
Qos = ‘blue’ ) “e
ple. Fa ("Masts Cam pasicon i) 7%
IE. ulabel a Nails fang |) ee
“pit-ylabel ("Masts Scored” . #
Ae Fenn CF : e
Ib. tha C Mads Grfancan