0% found this document useful (0 votes)
12 views29 pages

Pandas and SQL Practical Exercises Guide

The document outlines a series of practical exercises related to data manipulation using Pandas and SQL. Each practical task involves creating or manipulating data structures such as Series and DataFrames, performing arithmetic operations, importing/exporting data, and analyzing results. The exercises also include SQL operations like creating tables, inserting, deleting, and querying data.

Uploaded by

avd8793
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)
12 views29 pages

Pandas and SQL Practical Exercises Guide

The document outlines a series of practical exercises related to data manipulation using Pandas and SQL. Each practical task involves creating or manipulating data structures such as Series and DataFrames, performing arithmetic operations, importing/exporting data, and analyzing results. The exercises also include SQL operations like creating tables, inserting, deleting, and querying data.

Uploaded by

avd8793
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

Practical No-1 Create a pandas series from a dictionary

values and ndarrays.


Input:

Output:
Practical No-2 Create a Series object ‘vowel’ to store all
vowel a individually, its index should be 1, 2, 3 ,4, 5
Input:

Output:
Practical No-3 Create a Series using ndarray that has 5
elements in the range 50 and 100.
Input:

Output:
Practical No-4 Create Series object using dictionary to
that stores the no of students in each section of class
12th of our class.

Input:

Output:
Write a program to generate a series of float numbers
from 41.0 to 60.0 with an increment of 2.5 each
program.
Input:

Output:
Practical No-6 Given a Series, print all the elements that
are above the 75th percentile.
Input:

Output:
Practical No-7 Write a Pandas program to perform
arithmetic operations on two Pandas Series.
Input:

Output:
Practical No-8 Create a data frame based on ecommerce
data and generate descriptive statistics
Input;

Output:
Practical No-9 Locate the 3 largest values in a data
frame.
Input:

Output:
Practical No-10 Subtract the mean of a row from each
element of the row in a Data Frame
Input:

Output:
Practical No-11 Importing and exporting data between
pandas and CSV file. # To create and open a data frame
using ‘Student_result.csv’ file using Pandas. # To
display row labels, column labels data types of each
column and the dimensions # To display the shape
(number of rows and columns) of the CSV file.
Input:

Output:
Practical No-12 Replace all negative values in a data
frame with a 0.
Input:

Output:
Practical No-13 Create a Data Frame quarterly sales
where each row contains the item category, item name,
and expenditure. Group the rows by the category and
print the total expenditure per category.
Input:

Output:
14. Read the ‘Student_result.csv’ to create a data frame
and do the following operation: # To display Adm_No,
Gender and Percentage from ‘student_result.csv’ file. #
To display the first 5 and last 5 records from
‘student_result.csv’ file.
Input:

Output:
Practical No-15: Filter out rows based on different
criteria such as duplicate rows
Input:

Output:
Practical No-16 Given the school result data, analyses
the performance of the students on different parameters,
e.g subject wise or class wise.
Input:

Output:
Practical No-17 For the Data frames created above,
analyze, and plot appropriate charts with title and
legend.

Input:

Output:
Practical No-18 Write a program to plot a bar chart in
python to display the result of a school for five
consecutive years.
Input:

Output:
Practical No-19 Take data of your interest from an open
source (e.g. [Link]), aggregate and summarize it.
Then plot it using different plotting functions of the
Matplotlib library
Input:

Output:
Practical No-20 Write a SQL query to order the (student
ID, marks) table in descending order of the marks.
Practical No-21 Create a student table with the student
id, name, and marks as attributes where the student id is
the primary key.
Practical No-22 Insert the details of a new student in the
above table

Practical No-23 Delete the details of a particular student


in the above table.

Practical No-24 Use the select command to get the


details of the students with marks more than 80.
Practical No-25 Create a new table (order ID, customer
Name, and order Date) by joining two tables (order ID,
customer ID, and order Date) and (customer ID,
customer.

Practical No-26 Create a foreign key in one of the two


tables mentioned above
Practical No-27 Find the min, max, sum, and average of
the marks in a student marks table.

Practical No-28 Find the total number of customers


from each country in the table (customer ID, customer
Name, country) using group by.

You might also like