0% found this document useful (0 votes)
32 views44 pages

Lucknow Public School - 20241201 - 220143 - 0000

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)
32 views44 pages

Lucknow Public School - 20241201 - 220143 - 0000

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/ 44

LUCKNOW PUBLIC SCHOOL

2024-25

PROJECT FILE

Submitted by:
SALMAN AHMAD KHAN
PROGRAM-1
To create containing and van display 2D
array like olject array of even numbers

import pandas as pd #importing-pandas

$1= pd. Series (range (0,10,2)) #creating-series

print (52) #printing-series

OUTPUT:

0 0
1 2
3 4
2 4
6 B

dtype: int 64
PROGRAM-2
To that each create stores section a series no. the of
your object using a dictionary of students class

import pandas as pd #imperting pandas

b= dict = ['a': 20, 'b':40, 'c':60, 'd':80, 'e': 90}


#creatingdictionary
4= dict Values (7
$2= pd.series (6) # creating Series
print (52) # printing series

OUTPUT:
PROGRAM:3
To convert np array to Pandas Series.
import pandas as pd #importing pandas

import numpy as np #importing numpy

N1= nod array ((1,2,3,4,5] #creating numpy


series

53- pd. Series (NA) #creating pandas series

print (53) # printing series

OUTPUT:
PROGRAM-4
To add, subtract, multiply pandas Series.
and divide, two
import pandas as pd #importing pandas

S1= pd. Series (C1,2,3,4,57) #creating series

S2= pd. Series (15,8, 15,24,357) # using operaters

Add $1+52

Sub 52-51

Mul = S251

Div= S2/S4. #printing Series

print ("Series 1")

print (S2)

print("Addition, s

print ("Series 2")

print (S2)

print ("Addition", Adal)

prind ("Subtraction", Sule)

print ("multiplicetion", mul

print ("Division", Div)


OUTPUT:
PROGRAM-5
To compare the elements of two pandas series.

import pandas as pd. #importing pandas

L1= []

L2=[] # creating lists

n1= int (inpult ("Enter n2= no of elements in series 1"1)) int (input ("Enter no. of
elements in Series 2"))

print("Enter elements of 21:")

for i in range (11):

int (in peut (1)

11. append (a) #appending list

print ("Now enter elements of 12. for range (n2):

b= int (input()) 12. append (b)

S1= pd. Series (1) # creating series

S2: pd. Series (12)

print (S1 ==S2) # comparing series


OUTPUT:
PROGRAM-6
Writt a Specify Program data to create
dataframe from a and index valve.
name: [amit, Ankit, Amar, Anthony, Ajay, Rahul, Rohan]

Score: [12.5, 9, 16.5, np. NaN, 9, 20, 197]

attempts: [1, 3,3,3,2,3,11]

qualify: (Eyes, no, yes no, no yes, yes)

Labels: (a, b, c, d, e, fig)

import pandas as pd. #importing library pandas

import numpy as np. #importing literary numpy

dist 1 = { 'name': ['amit', ankit', 'amar', anthony', ajay', 'ra


rahul, irohan' I, Score': [12.5, 9, 16.5, hp.NaN, 9, 20,
197,'attempts':[1,3,3,3,2,3,11],

"qustify': ['yes', 'no', 'yes', 'no', 'no', 'yes', 'yes'] }

Labels: ['a', 'b', 'c', 'd', e f g ]

df2 = pd. Data Frame (dict 2, inter = Levels) print (df 2) ls)
wist. #creating dataframe
OUTPUT:
PROGRAM-7
write a program to display summary of
basic info about given dataframe
(Using dataframe created in Program 6)

df=import pandas as pd. # importing pandas

df= pd. DataFrame (dicts, index = labels)

print (idf.info())

OUTPUT:
PROGRAM-8
Write a of a Pandas Program given
dataframe to get first three rows

import pandas as pd

df= pd. Data Frame (dict 1, inden = Labels)

print (df. head (3))

OUTPUT:
PROGRAM-9
Write a Program to select name & score
column from given dataframe.
(Using dataframe of Program 6)

import pandas as pd

df= pd.DataFrame (dict 1, index = "Labels")

print (df [['name', 'score']))

OUTPUT:
PROGRAM-10
Write a Pandas program to select specified &
columns,rows from given dataframe.

import pandas as pd. #imparting pandas

L1 = [] # creating empty lists

Ir = []

df= pd. Dataframe (dicts, index = labels) #creating dictionary

print("seled the columns from (name', 'score',' attempts'", "qualify']")

n1 = int (input ("Enter the no. of cols you want: "))

for i in range (n1):

C= input()

Ic. append opend (c)

print ("select the rows from ['a', 'b, c, d, e, f, g']")

n2= int (input ("Enter the no. of rows you want:"))

for i in range (n2):

r= eval (input())

dr.append (r)

olf 1 = df. loc [er, Ic)

print (df 1) #desined datofname


OUTPUT:
PROGRAM-11
write a attempts program to select the rows where
number of attempts in the examination is less than 2.

import pandas as pd

elf = pd. Data Frame (dists, index = labels)

print (df. loc [of ['attempts']'ca])

OUTPUT:
PROGRAM-12
Write in a Program to count no. Rows &
columns of given dataframe.

import pandas as pd. #importing pandas

df= pd. DataFrame (dicts, index= "labels)

S= df. shape

print ("Pro. of cows = ""; S[0]) #no of rows

print (" No. of columns =", S[1]) #no. of columns

OUTPUT:
PROGRAM-13
Write a Program to change score in your
add to 11.5.

import pandas as pd

df = di pd.Data Frame (dict 1, index = Labels)

df, score ['d']=11.5 #changing score

print (df)

OUTPUT:
PROGRAM-14
write a Program to append a new row 'h' to
dataframe with given values for each column.
Now delete new and return original dataframe.
import pandas as pd

#importing pandas

df = pd.DotaFrame (dicts, index = labels)

df.at ['h',:] = ['kiran', 11, 1, 'no'] #appending new

print (df)

elf = df: drop (n) print (df) # deleting existing


row
OUTPUT:
SQL
PROGRAMS
PROGRAM-15

import matplotlib.pyplot plt. barh (( cats', as plt


s', Des", "Goldfish", Snakes, align="center",
'Turtles']

label='data1'

plt. legend()

plt. ylabel('Pets'), plt. xlabel('Popularity')

plt. ('Popularity of pets in the neighbour honor)


plt.show()
OUTPUT:
PROGRAM-16

import matplotlib.pyplot as plt


plt.bar ([0.28, 1.25, 2.5, 3.28, 4.28], [50,40, 70, 80,
203]

plt. bar ([.75, 1.75, 2.78, 3.75 4.75), [80, 20,


20,80,60),"label = 'Audi', color = 's', width = 0.5])

plt. legend()

plt. xlabel("Days')

plt.ylabel Distance (kms)")

plt.title 'Information')

plt.show()
OUTPUT:
PROGRAM-17
import matplotlib.pyplot as plt
Year=(1920, 1930, 19904-1980, 1960, 1970, 1980, 1990,
2007,2010)

Unemployment-Rate= [9.8, 12.8, 7.2, 6.9, 7, 6.5, 6.2,

plt. plot (Year, Unemployment- Rate Vs Year')

plt title Unemployment

plt.xlabel ('years')

plt.ylabel Unemployment Rate')

plt grid (True)

plt. (show)
OUTPUT:
PROGRAM-18
import day= matplotlib.pyplot as plt

day=['Mon', Tue Wed thu', 'fri', 'Sat', Sun']

baby-One = [15, 13, 17, 9, 11, 19, 13]

baby-two = = [12, 10, 18, 14, 16, 20, 7]

plt.plot(day, baby-one, color = 'Blue' line Chart 2 = ullt plat (ddy, baby-two,
color="Red")

plt.xlabel(Day", color & plt ylabel( Birth Rate, color. r = 'green')

plt title (arctic hospital plt. legend ([1-4 July']) '8-14July 2019'
plt.show last week birth sate") 8-14 July 2019'), loc 3)
OUTPUT:
QUERIES
QUESTION-1
TABLE:Employee

TABLE:JOB
To display employee ids, names of
empelysees, job ids with coresponding job
titles.

Select employee id, Name, Sales, e-job-90, Job Title


FROM employee e, job WHERE e. job-90job-ID;

To display names of employees, sales who


have achieved sales & corresponding job
than 1300000.

SELECT Name, Sales, Job Title


FROM employee e, job j
WHERE e. Job ID
j. Job ID AND Sales >1300000;
To display tholl in their names &
corresponding jol titles of Ihose employees
who have 'singh' (anywhere.) In their
names.

SELECT Name, Job. Title


FROM employee e, job j
WHERE e. Job 90. J. Jab 10
AND Name like "I. SINGHY";

Identify foreign key in the table


EMPLOYEE.
A Foreign Key is a key used to link taro tables
together. A Foreion key is a key of other frenary
sorkey the field in one table. In same purpose. table
that refers employee table, to Job
write sql command to change the JOBID to
104 of the EMPLOYEE with ID as E4 in the
table "EMPLOYEE"

UPDATE Employee

SET JOBID 104

WHERE employee-id="F4";
QUESTION-2
Give output for following Sql queries as
per given table:

TABLE: Garments
TABLE:Fabric

Select SUM (PRICE) FROM GARMENT


WHERE FCODE = 'FO1';
Select Description, Type from Garments, Fabric where
Garment, FCode - Fabric. FCode And garment. Price = 1260;

OUTPUT:
Select Max (Foode) FROM FABRIC;

Select Count (Distinct Price) For From


Garments;
OUTPUT:
QUESTION-3
Give output for following sql queries as per
given table.

Table:Sender

Table: Recipient
Select Distinct senderCity From Sender;

Select A. Sender Name, B. Rec Name FROM


SENDER A , RECIPIENT B
WHERE A-Sender ID B. Sender ID AND
B.RecCITY = 'Mumbai';
Select Rec Name, Rec Adress From Recipient
where Reclity not in (Mumbai, kazat);

Select RecID, Rec Name FROM Recipient


where Sender 90 - "Muox' or send
190=105?
This is to certify that Salman Ahmad Khan
Class 12th 'A' of Lucknow Public School
Roll No.33 has successfully completed his
Information Practices project file. He has
taken proper care and utmost sincerity in
completion of his project. All the work
related to the project was done by the
candidate himself.

SUB.TEACHER SIGN PRINCIPAL SIGN


________________ _____________
I want to express my deep
gratitude to my Computer
teacher, Mr.Sumit Srivastava,
and Principal Sukansha
Awasthi for their exceptional
support throughout the
project.

EXTERNAL EXAMNIER INTERNAL EXAMNIER


_________________ _________________

You might also like