0% found this document useful (0 votes)
43 views

IP Practicals Filed

The document contains programming assignments on Pandas series, dataframes, Matplotlib plotting, SQL queries. For Pandas, the assignments cover creating series from lists and dictionaries, operations on series, creating dataframes from dictionaries and lists, adding/deleting rows and columns. For Matplotlib, the assignments involve creating line plots, bar plots, histograms from data and customizing the plots. The SQL assignments involve creating tables, inserting data, querying records with filters and aggregations, updating and deleting records.

Uploaded by

kashinathchandak
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
43 views

IP Practicals Filed

The document contains programming assignments on Pandas series, dataframes, Matplotlib plotting, SQL queries. For Pandas, the assignments cover creating series from lists and dictionaries, operations on series, creating dataframes from dictionaries and lists, adding/deleting rows and columns. For Matplotlib, the assignments involve creating line plots, bar plots, histograms from data and customizing the plots. The SQL assignments involve creating tables, inserting data, querying records with filters and aggregations, updating and deleting records.

Uploaded by

kashinathchandak
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

Class 12 IP practical File

Series

1. WAP a program to create a blank series


2. WAP a program to create a series from list with labels
3. WAP a program to a create a series from two lists where first list will be values
and second would be indexes.
4. WAP a program to create a series from range()
5. WAP a program to create a series with Dictionary
6. WAP a program to create a series with scalar values
7. WAP a program to create a series from an array
8. WAP to create a series from the list [1,2,3,4,5,6,7,8,9]
A) Assign indexes as [‘a’,’b’,’c’,’d’,’e’,’f’,’g’,’h’,’i’]
B) Display the indexes ,values ,dimension, shape and size of the series
C) Also display whether series is empty or not
9. WAP a program to display first and last three values of the Series
10. WAP a program to find the sum ,difference, and product of two series S1 andS2

Dataframes

1. WAP a program to create a dataframe from dictionaries


2. WAP a program to create a dataframe from list of dictionaries
3.
4. WAP a program to create a dataframe from dictionaries of list
5. WAP a program to create a dataframe from series
6. Create the following DataFrame Sales containing year wise sales figures for five
sales persons in INR. Use the years as column labels, and sales person names
as row labels.

Use the DataFrame created above to do the following:


a. Display the row labels of Sales.
b. Display the column labels of Sales.
c. Display the data types of each column of Sales.
d. Display the dimensions, shape, size and values of Sales.
e. Display the last two rows of Sales.
f. Display the first two columns of Sales.
g. Check if Sales2 is empty or it contains data.
h. Append the DataFrame Sales2 to the DataFrame Sales.
i. Change the DataFrame Sales such that it becomes its transpose.
j. Display the sales made by all sales persons in the year 2017.
k. Display the sales made by Madhu and Ankit in the year 2017 and 2018.
l. Display the sales made by Shruti 2016.
m. Add data to Sales for salesman Sumeet where the sales made are [196.2, 37800,
52000, 78438, 38852] in the years [2014, 2015, 2016, 2017, 2018] respectively.
n. Delete the data for the year 2014 from the DataFrame Sales.
o. Delete the data for sales man Kinshuk from the DataFrame Sales.
p. Change the name of the salesperson Ankit to Vivaan and Madhu to Shailesh.
q. Update the sale made by Shailesh in 2018 to 100000.
r. Write the values of DataFrame Sales to a comma separated file SalesFigures.csv
on the disk. Do not write the row labels and column labels.
s. Read the data in the file SalesFigures.csv into a DataFrame SalesRetrieved and
Display it.
7. WAP a program to create the following dataframe :

0 Name Marks Age Class


1 Aman 75 18 12
2 Tarun 63 18 12
3 Navya 64 18 12
4 Riya 78 18 12
A) Add a new row with the values(5,Rahul,63,18, 12)
B) Add a new column named ‘gender’
C) Rename the column Class to Grade
8. WAP a program to create the following dataframe :

Name English Hindi Mathematics Scienc SST


e
RNo1 Aman 65 56 78 78 76
RNo2 Siya 67 78 78 56 67
RNo3 Riya 75 65 79 65 78
A) Add a new column with name IP
B) Calculate the average marks of subjects for each student in the new
column.
9. Create a dataframe and iterate them over rows and columns.
10. Create the following DataFrame Sales containing year wise sales figures for five
salespersons in INR. Use the years as column labels, and salesperson names as
row labels.

 Create the DataFrame.


 Display the row labels of Sales.
 Display the column labels of Sales.
 Display the data types of each column of Sales.
 Display the dimensions, shape, size and values of Sales.

Matplotlib

1. Plot the following data on a line chart and customize the chart according to the
below-given instructions:
 Write a title for the chart “The Monthly Sales Report“
 Write the appropriate titles of both the axes
 Write code to Display legends
 Display blue color for the line
 Use the line style – dashed
 Display diamond style markers on data points

2. Create the following data frame and plot the line chart for the same :

Months Sales2010
January 75000
February 80000
March 85000
April 62000
May 45000
June 60000

A) Give label for x axis and y axis


B) Give title to chart and also save chart
C) Give marker size of 10;line style ;line width ;colour

3. Write suitable Python code to create 'Favourite Hobby' Bar Chart as shown below:
Also give suitable python statement to save this chart.

4. The heights of 10 students of eighth grade are given below:


Height_cms=[145,141,142,142,143,144,141,140,143,144] Write suitable Python
code to generate a histogram based on the given data, along with an appropriate
chart title and both axis labels. Also give suitable python statement to save this chart.

5. Write a python program to plot a line chart based on the given data to depict the
changing weekly average temperature in Delhi for four weeks.
Week=[1,2,3,4]
Avg_week_temp=[40,42,38,44]

6. Write a Python program to display a bar chart of the number of students in a school.
Use different colours for each bar. Sample data:

Class: I,II,III,IV,V,VI,VII,VIII,IX,X

Strength: 38,30,45,49,37,53,48,44,36,46

SQL

1. Create the following table: Employee

Field Name Datatype Constraint


Empid Integer Primary Key
Name Varchar (20)
Department Varchar (20)
Salary Integer
Gender Varchar (1)
DOJ Date

1. Write SQL query to create the table Employee


2. Write SQL query to insert any 10 records in the Employee table.
3. Write SQL query to display all the records of all Female Employees.
4. Write SQL query to display total salary of all the Employees.
5. Write SQL query to display the average salary of Employees.
6. Write SQL query to display the details of Employees with salary more than 40000.
7. Write SQL query to display the total number of male Employees in the table.
8. Write SQL query to display the maximum and minimum Salary of Employees
9. Write SQL query to display the detail of Employee who joined in year 2015.
10. Write SQL query to display name of employees in upper case who joined on
“Wednesday”.
11. Write SQL query to display first 4 alphabets of Employee Name and last 3 characters
of Department of all Employees.
12. Write SQL query to display the salary Department wise.
13. Write SQL query to display the maximum and minimum salary for male and female
employees.
14. Write SQL query to change the name to Aman corresponding to employee id E9.
15. Write SQL query to delete the records of those whose name starts with ‘T’ and has 5
characters.
16. Write SQL query to arrange all the details in decreasing order of salary.
17. Write SQL query to count the number of employees in each department.
18. Write SQL query to display 10% of salary.
19. Write SQL query to display name and department together.
20. Create another table “Dept” with the following structure:
Empid | Dept_name | Salary | Dept_id
21. Write queries to insert 5 records into the “Dept” table.
22. Display emp_id, employee name and department name of all employees from the
table Dept and Employee.
23. Display the average salary of each department.

You might also like