0% found this document useful (0 votes)
16 views30 pages

12th IP Project

Uploaded by

akashdhoundiyal9
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)
16 views30 pages

12th IP Project

Uploaded by

akashdhoundiyal9
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/ 30

INDEX

1. 15 Programs using pandas

2. 4 Programs using Matplotlib

3. 15 SQL Queries
PROGRAMS USING PANDAS
Practical 1:Create a Series object using the python sequence with 5 elements:

Solution:

Output:
Practical 2: Create a Series object ‘vowel’ to store all vowels individually.Its index should
be 1,2,3,4 & 5:

Solution:

Output:
Practical 3: Create a Series object using ndarray that has 5 elements in the range 50
and 100:

Solution:

Output:
Practical 4: Create a Series object using Dictionary to that stores that no of students in each
section of class 12th of your school:

Solution:

Output:
Practical 5: Total no of students to be admitted is 350 in yojana School every year.Write
code to create a Series object ‘School’ that stores these total no of students for the year
2015 to2022:

Solution:

Output:
Practical 6:Create a Series object ‘item’ that stores rate of each product as given below:
Soap 54
Salt 20
Sugar 39
Write code to modify rate of soap to 44 and sugar to 42. print the changed rate.

Solution:

Output:
Practical 7:No of students in class 11 and class 12 in three streams(science,commerce and humanities )are
stored in 2 series object class 11 and class 12 .write code to find total no of students in class 11 & class 12
stream wise.

Solution:

Output:
Practical 8:Write a Pandas program to append a list of dictionaries or series to an existing DataFrame
and display the combined data.

Solution:
Output:
Practical 9:Write a Pandas program to add some data to an existing Series.

Solution:

Output:
Practical 10:Create a pandas series from a dictionary of values and an ndarray.

Solution:

Output:
Practical 11:Locate the 3 largest values in a data frame.

Solution:

Output:
Practical 12:Replace all negative values in a data frame with a 0.
Solution:

Output:
Practical 13:Given a Series, print all the elements that are above the 75th percentile.

Solution:

Output:
Practical 14: Write a program to generate a series of these numbers: 33,55,65,29,19,23. Find the sum of those values which
ends with 3 or 5.

Solution:

Output:
Practical 15:Write a program to generate a series of 5 elements of multiples of 7 starting with 35 with index multiply by
3.

Solution:

Output:
PROGRAMS USING MATPLOTLIB
Practical 1:Given the school result data, analyses the performance of the students on different
parameters, e.g subject wise or class wise.

Solution: Output:
Practical 2:Write a program to plot a bar chart in python to display the result of a school for five
consecutive years.

Solution: Output:
Practical 3: Observe the given data for monthly views of one of the youtube channels for 6 months. Plot them on
the line chart.

Month January February March April May June


Views 2500 2100 1700 3500 3000 3800

Solution: Output:
Practical 4:Write a program to plot a range from 1 to 30 with step value 4. Use the following algebraic
expression to show data.
y = 5*x+2

Solution: Output:
SQL QUERIES
1. Create a student table with the student id, name, and marks as attributes where the student id is the primary key.

2. Insert the details of a new student in the above table.


Table data:

3. Delete the details of a student in the above table.


4. Use the select command to get the details of the students with marks more than 80.

5. Find the min, max, sum, and average of the marks in a student marks table.
6. Find the total number of customers from each country in the table (customer ID, customer
Name, country) using group by.

select country, count(customer_id) from


->
customer group by country;

7. Write a SQL query to order the (student ID, marks) table in descending order of the marks.
8.Write a SQL query to display the marks without decimal places, display the reminder after diving marks by 3 and display
the square of marks.

9.Write a SQL query to display names into capital letters, small letters, display frist 3 letters of name, display last 3
letters of name, display the position the letter A in name.
10. Remove extra spaces from left, right and both sidesfrom the text – “ Informatics Practices Class XII” .

11. Display today’s date in “Date/Month/Year” format.


12. Display dayname, monthname, day, dayname, day of month, day of year for today’s
date.

To write Queries for the following question based on the given table:

EmpID Name Gender Age Dept DOJ Salary City


1 Parveen M 25 Sales 1989-06-08 20000 Chennai

2 Arun M 29 Marketing 1989-09-26 22000 Chennai

3 Usha F 27 Finance 1994-08-09 25000 Bangalore


4 Bala M 31 Sales 1990-03-23 27000 NULL
5 Rani F 28 Marketing 1990-04-23 27000 Mumbai

6 Nisha F 26 NULL 1991-02-24 18000 Bangalore


7 Manoj M 32 Finance 1982-05-06 30000 Goa
(a) Write a Query to Display Employees name and City from the above table.

SELECT NAME ,CITY FROM INFO;

Output:

(b) Write a Query to Display all details of Employees who are living in Chennai.

SELECT * FROM INFO WHERE CITY=‘CHENNAI’;

Output:
(c) Write a query to update increase 10% Salary of an employee whose City is ‘CHENNAI’ and Gender is ‘MALE’.

UPDATE INFO SET SALARY =SALARY+(SALARY*0.10) WHERE CITY=‘CHENNAI’ AND GENDER=‘MALE’;

Output(After Updating):

You might also like