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

Practical File 2025-26 Pandas, Matplotlib and SQL Query

The document outlines various practical exercises using Pandas, including creating Series and DataFrames from different data structures, displaying and manipulating data, and performing operations like filtering and adding columns. It also includes SQL queries for managing teacher data in a database. Additionally, it mentions creating visualizations using Matplotlib and working with CSV files.

Uploaded by

aditisingh8thd
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 views7 pages

Practical File 2025-26 Pandas, Matplotlib and SQL Query

The document outlines various practical exercises using Pandas, including creating Series and DataFrames from different data structures, displaying and manipulating data, and performing operations like filtering and adding columns. It also includes SQL queries for managing teacher data in a database. Additionally, it mentions creating visualizations using Matplotlib and working with CSV files.

Uploaded by

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

Pandas Practical File

Practical 1:- Create a Series from dictionary


RollNo 100
Name Sneha Sahoo
Index Class XII A
DOB 2005-05-20
Tmarks 489
Grade A
Practical 2:- Create a Series from ndarray.
Amit 456
Sneha 478
index Manya 467
Pari 477
Lavanya 489
Abhay 477
Practical 3:- Create a Series, print all the element that are above the 75th percentile.

[ 15, 16, 18, 27, 29, 32, 36]


Practical 4:- Create a Data Frame from List of Dictionary.

Country Population Birth_rate Update_date


China 137975000 12.00 2016-08-11
India 1330780000 21.76 2016-08-11
USA 324882000 13.21 2016-08-11
Indonesia 260581000 18.84 2016-01-07
Brazil 206918000 18.43 2016-05-11

Practical 5 :- Create a Data Frame for examination results, display row labels, column labels, types of
each columns and the dimensions by using dictionary.

Maths Physics Chemistry IP English


Suyash 94 90 93 95 92
Amit 95 98 96 90 91
Ankur 98 90 89 92 94
Aditya 90 88 92 95 88
Akash 97 91 89 92 90

Practical 6 :- create a DataFrame called df.

Name Class English physics chemistry Maths IP


0 Advik 11 85 70 60 55 80
1 Rohit 12 65 75 65 65 75
2 Ram 11 75 58 68 45 57
3 Shailesh 12 50 65 65 65 45
4 Atharv 12 65 75 75 58 65
5 Nitesh 12 58 74 65 52 85
6 Kundan 11 70 62 52 52 80

i. Display Student name and Marks of Maths and IP subjects.


ii. Display the records of students of class 11.
iii. Display student name and marks of Physics for all the students
iv. Display the records of the students whose marks are less than 55 in Maths subject.

Practical 7:- Consider the given DataFrame ‘Genre’:


Type Code
0 Fiction F
1 Non Fiction NF
2 Drama D
3 Poetry P
Write suitable Python statements for the following:
i. Add a column called Num_Copies with the following data:
[300,290,450,760].
ii. Add a new genre of type ‘Folk Tale' having code as “FT” and 600 number of copies.
iii. Rename the column ‘Code’ to ‘Book_Code’
iv. delete second record of DataFrame ‘Genre’

Practical 8:- For the following DataFrame batsman:

B_No Name Score1 Score2


1 Sunil Pillai 90 80
2 Gaurav Sharma 65 45
3 Piyush Goel 70 90
4 Kartik Thakur 80 76
i. Add new column ‘Total’ to the DataFrame with values (addition of Score1 and Score2).
ii. Print the maximum value of ‘Score1’ and ‘Score2’ columns.

Practical 9: - Consider the following DataFrame , XII;

Name RollNo English Hindi Maths SSc Science


0 Zahid 1 55 45 87 67 70
1 Moin 2 67 65 90 87 56
2 Ishrat 3 78 76 98 90 78
3 Neha 4 98 87 78 45 87
4 Prateek 5 45 58 90 69 98
Write code to display the dataframe ‘XII’ row-wise.

Practical 10. Create dataframe from csv file using notepad.


Practical 11. Create dataframe from csv file using MS Excel.

Practical 11. Create dataframe from SQL table using sql Database.

Based on Topic Matplotlib Program


Program 12 write a Python script to display line chart of the below given data:
Program 13 :- Smile NGO participated in a 3 week cultural Mela. Using Pandas, they have stored in
Sales (In Rs.) made day wise for every week in a CSV file named “MelaSales.csv” as below:
Program 14 : write a Python script to display bar plot for the “MelaSales.csv” with column day on x
axis as show below:

Program 15 :
SQL Queries
Dear students first you create table
Table name – teacher and insert these records in MySQL software
Query 1 – Write a SQL Query to display the maximum salary of each department.
Query 2- Write a SQL query to display the minimum salary of each department.
Query 3- Write the SQL query to display the maximum salary of those department whose
department salary more than 90,000.
Query 4- write the SQL query to display the maximum salary whose salary between 90,000
and 110,000.
Query 5 – Write the SQL query to display the minimum salary of each department whose
salary is less than 85000.
Query 6 – Write a SQL query to display average salary of each department.
Query 7 – Write a SQL query to display average salary of each department whose average
salary is more than 100,000.
Query 8- Write a SQL Query to display the total salary of each department.
Query 9- Write a SQL Query to count the employee of each department.
Query 10 – Write a SQL Query to display teacher name in lower case along with column
teacher number and salary.
Query 11 – Write a SQL query to display teacher name in upper case along with column
teacher number and date of joining.
Query 12 – Write a SQL Query to display first seven letter in teacher name along with
column teacher number and salary.
Query 13 - Write a SQL Query to display last six letters in teacher name along with column
teacher number and salary.
Query 14 - Write a SQL Query to display of first occurrence of substring “the” in the
teacher address along with teacher name and teacher address.
Query 15 - Write a SQL Query to display 7 characters extracted from 7th left character from
the teacher’s name along with teacher name and teacher address.
Query 16 - Write a SQL Query to display total number of characters in teacher’s name ess
along with teacher number, teacher name and department number.
Query 17 – Write a SQL Query to display month name from date of joining along with
column teacher name and department number.

You might also like