Professional Documents
Culture Documents
Adobe Scan 25 Nov 2023
Adobe Scan 25 Nov 2023
CKC AC AD EM Y
l ~ . .
l--
~
'
:~
~, ·~
JH AN SI
1--...
'~
.;} ;
~
cc '
INFORMATION PRACTICES .,
i•
·; : PRACTICAL FILE
AISSCE EXAMINATION
SESSION _ 2022-2023
'tt
~_;~
~
~~-
~,&
,i'"
~-
¥1"!
~ Riya Ahirwar
~
~
~ Acknowledgement
~ I wish to express my deep sense of gratitude and
indebtedness to our learned teacher Mr. Atul Kumar
Sahu, PGT COMPUTER SCIENCE, CKC Academy
for his invaluable help, advice and guidance in the
preparation of this project.
I am also greatly indebted to our principal Fr. Sagaya
Nathan and school authorities for providing me with the
facilities and requisite laboratory conditions for making
this practical file.
I also extend my thanks to a number of teachers, my
classmates and friends who helped me to complete this
practical file successfully.
-..
..
c...
#
c....
~
~
rr '
,.••
~
.,....---
Riya Ahirwar
::...• Certificate
....
.....
This is to certify that Riya Ahirwar student of Class XII,
::
..,__.
FILE during the academic year 2022 - 2023 to wards 1
Signature: Signature:
'--~ '
• //.~-1
Head of the Department Pnfr ·Seal
Signature: and~tDature:
Riya Ahirwar
.,.
• 11 Data Handling -
Contents
...
....
S No.
1
Practicals
Create a panda's series
Oat£, Signature
~~ -
.,,..
from a dictionary of os-o:r- -2022
,.,,..-;-a112,- y'
• ◄
of each column and the
ti•
.,
dimensions .
3
I
Riya Ahirwar
.,cc._.
5 Find the min, max, sum, IS - JI-: 2.022.
te.. and average of the marks : i' ~ -
in a student marks table. lstt~
2. 2. - I I -2.022.
'
(ifz9l .
/v
~,,1-z- .
Name, country) using
group by.
7 Write a SQL query to
order the ( student ID, t(o'rit-
, ,I I ~?/'
marks) table in
descending order of the
2 9 - I I ""'2. 0 22. ~ l ''\"'
marks.
5
Riya Ahirwar
Data Handling
[ 1] Create a panda's series from a dictionary of values
and a ndarray.
import pandas as pd
import numpy as np
def pro30:
#Creating series from a dictionar y
d --{'J. an '·31 ,_ . , 'M ar '·31
. , 'Fpb'·28 . ,
'Apr':30}
S=pd.Series(d)
printC Series from dictio nary")
print(s)
;-.; . . '/:
~~-
f
It . !
l', Riyn Ahirwar
•• pri nt( '' ,.,~,-· ... '" '"" "" '" ,.,, .,.
s1 =pd.Series(ar)
, ., .. , . -. , - • . , r'r • ")
•
.)It print(s1)
~
-- pro30
i~
File
IDLE Shell 3.11 .0
...-..
App Dat a/L oca
>>> =RE STA RT: C:/U sers /AS US/
oatn umb ers . py
Ser ies from dic tion ary
Jan 31
Feb 28
Mar 31
....
._
~ Apr
dty pe:
30
int6 4
._ 1
0 2
3
4
2
~ 3 5
4 6
~ dty pe: int3 2
~ >» /I
- · -- -- - --- - - ---- --- ---- -- -
- - - -- - - - - -
Ln: 21 Cot~j
~
~ ~
'
,,.
~
I
r
ven a Se ries, print all the elements that are above
[2] Gi
the 75th percentile .
,• ••
• •e
"'. I
Iii
'1iiiii
I •
~
• 7
Riya Ahirwar
•
•
I
•
•
-
••
import pandas as pd .
def Ser_stumarks():
-- std_marks = []
-- for i in range( 1, 6):
at
-
~
'!!!la
m = int(input("Enter the Percentile:"))
'!!le
std_marks.append(m) 4
....
~
~ s = pd.Series(index=range(1201,1206),
,....
~
data std_marks)
,...
,... print("Data fetched from the Series
,-4 are:")
,,,,.
~ print(s[s>=7 5])
,...re.
......
__I
~
~
i.
4--
f
8
Riya Ahirwa r f.\ ...
D X !
· ,A IDLE Shell 3. 11 .0
I File Edit Shell Debug Options Window Help
on/Py th o
>>>=R ESTAR T: c:/Use rs/ASU S/App Data/L ocal/P rogram s/Pyth
n311/p ercent ile.py =
Ente r the Per:ce ntile:6 3
l~nter: the Per:ce ntile:7 8
!Enter: the Per:ce ntile:5 2
: Enter the Per:ce ntile:8 8
!Enter the Percen tile:83
!Data fetche d from the series are:
: 1202 78
j 1204 88
1205 83
ldtype : int64
:~:I Ln: 6 Col:O
r: ..-. :
• t• Name ':['Sanitizer', 'Sugar', 'Tshirt'], 'Expenditure':
[1000,500,5200]}
quarterly_sales-pd.DataFrame(data)
print(quarterly_sales)
2•
I
c=quarterly_sales.groupby('Category')
,p
f • print('Result after filteri ng')
• • print(c['Category', 'Expenditure'].sum())
• •
9
-
.. .. ..
\I
-~ - ~♦ ww
•-•
Riya Ahirw ar
.-..
RESTART: C:/Use rs/ASU S/App Data/L oca l/P rog rams/ Pytho n/Pyth
on311 /,k.py ==--=
catego ry Item Name Expen diture
0 Medic al Sanit izer
-- I
1000
1 Groce rry sugar 500
2 Cloth es Tshir t 5200
!Resu lt after filter ing
Expen diture
-_ J
~
..,.. >
Categ ory
Cloth es
Groce rry
Medic al
- -- ---
5200
500
1000
---- - - - ----- -- --- -· -·- - - - - - - -
I
....
Ln: 19 Col: 226
.,_
~
t:M
t!lle
....
~
,...
~
,,_
def df_std_resO:
res={'Amit':[76,78,75,66,68],
,...
~
,...
'Shi aIesh ':[78,56, 77,49,5 5],
'Rani':[90,91,93,97,99],
....
-l
'Madan':[55,48,59,60,66],
'Radhika':[78,79,85,88,86]}
df= pd.DataFrame(res)
10
Riya Ahirwar
idx=df.index
I= Ii st(idx)
print(!)
print("Prinitng row labels in a list:")
print("~~ ~~ ~~~~~~~~~~~~~~~~~~~~~~~~~··)
print("[",end=" ")
for col in df.columns:
print(col,end=" ")
print("]")
••
print("Printing Data Types of
each column")
print(df.dtypes)
• 8 . ("
prrnt ~~~~~~~~~~~~~~~~~~~~ ~ ~ ~~ ~~~ ~~")
., ••
9
print(df.ndim)
.. ,.• df_std_resO
~ ' } ,::
.......
-·~·-
Dlai I
•
11
Riyn Ahirwar
'yes', 'yes',
'no', 'no',
'yes']}
exam_data1 = pd.DataFrame(exam_dic1)
." ;• print(exam_data 1)
print(" \nUse = = opera tor\n")
".
_, P•
print(exam_data1 .loc[exam_data1 ['name '] ==
'Rohan '])
• r•
• ••
•• •e p ri nt("\n Use < ope rato r\n ")
. ,.
• ••
,.I. 13
- 4~
. . .~ .:J..f). ;,: :~ ·\::~ ~~_;'.;\:.~~~~ ~-},>r:?~~~~~q :~~:- ~~.:~·: .:~~~:~: .~~~'S~;~~:-T5r ,·/~-~~
t Riya Ah irwar
••
-
.•
401)
.•
"9
!= 'no'])
•
-- <40)])
--
~
# Filter out rows based on diffe rent crite ria
rows
such as dup lica te
r-.
,.. 'Sales':[8500,4500,9200,8500,9200,9600,84
..,... O]}
....... sales=pd.DataFrame(data)
# Find duplicate rows
....
...,_
Duplicated = sales[sales.duplicated(keep= Fals
prin t("d upli cate Row :\n" ,dup lica ted)
e)]
....,J I
e
•
14
... '
' '' .l I I . I I
J - -
' I J
·- -
I
I . I 'I
I
11-t _:--
I .
·-
!
I
Ii - •
..-( I
.. I
_.· \ -·
VJ I I
p .:I=--,
d -
', j"" =-~ I' ,,
1
1 I
. - , :1 /' ' It;
1
l vi
;,l 'I
...J •
-
.x
. II f
I \
~~---=--=-
I •
\ ,.
I \'·
·~ [1 iI,
'II,
' 1:
. Ii