0% found this document useful (0 votes)
3 views6 pages

Pandas Matplotlib SQL Practical File

This document is a practical file for a Data Science course covering Python (Pandas & Matplotlib) and SQL for the academic year 2025-26. It includes various programs demonstrating the use of Pandas for data manipulation, Matplotlib for data visualization, and SQL queries for database management. Each section provides code examples for specific tasks such as creating data structures, handling data, and executing SQL commands.

Uploaded by

dhananjaymishr75
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)
3 views6 pages

Pandas Matplotlib SQL Practical File

This document is a practical file for a Data Science course covering Python (Pandas & Matplotlib) and SQL for the academic year 2025-26. It includes various programs demonstrating the use of Pandas for data manipulation, Matplotlib for data visualization, and SQL queries for database management. Each section provides code examples for specific tasks such as creating data structures, handling data, and executing SQL commands.

Uploaded by

dhananjaymishr75
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

DATA SCIENCE PRACTICAL FILE

Subject: Python (Pandas & Matplotlib) and SQL


Academic Year: 2025–26

Student Name: ______________________


Roll No: ______________________
Class & Section: ______________________
College Name: ______________________
Section A: Pandas Programs

Program 1

Aim: Create a Pandas Series

Code:
import pandas as pd
data = [10,20,30,40]
s = [Link](data)
print(s)

Program 2

Aim: Create DataFrame

Code:
import pandas as pd
data={'Name':['Amit','Neha'],'Marks':[85,90]}
df=[Link](data)
print(df)

Program 3

Aim: Read CSV File

Code:
df=pd.read_csv('[Link]')
print(df)

Program 4

Aim: Display first & last records

Code:
print([Link]())
print([Link]())

Program 5

Aim: Check data types

Code:
print([Link])
Program 6

Aim: Describe data

Code:
print([Link]())

Program 7

Aim: Select column

Code:
print(df['Marks'])

Program 8

Aim: Add column

Code:
df['Passed']=df['Marks']>=40
print(df)

Program 9

Aim: Delete column

Code:
[Link]('Passed',axis=1,inplace=True)

Program 10

Aim: Filter data

Code:
print(df[df['Marks']>80])

Program 11

Aim: Sort data

Code:
print(df.sort_values('Marks'))

Program 12
Aim: Handle missing values

Code:
[Link](0,inplace=True)

Program 13

Aim: Rename column

Code:
[Link](columns={'Marks':'TotalMarks'},inplace=True)

Program 14

Aim: Save CSV

Code:
df.to_csv('[Link]',index=False)

Program 15

Aim: Display shape

Code:
print([Link])
Section B: Matplotlib Programs

Program 16

Aim: Line Graph

Code:
import [Link] as plt
x=[1,2,3]
y=[10,20,30]
[Link](x,y)
[Link]()

Program 17

Aim: Bar Chart

Code:
[Link](['A','B'],[80,90])
[Link]()

Program 18

Aim: Pie Chart

Code:
[Link]([40,60],labels=['Python','Java'])
[Link]()

Program 19

Aim: Scatter Plot

Code:
[Link]([1,2,3],[4,5,6])
[Link]()
Section C: SQL Queries

Table: STUDENT(RollNo, Name, Age, Marks, City)

1. SELECT * FROM STUDENT;

2. SELECT Name, Marks FROM STUDENT;

3. SELECT * FROM STUDENT WHERE Marks>80;

4. SELECT * FROM STUDENT WHERE City='Delhi';

5. SELECT * FROM STUDENT ORDER BY Marks DESC;

6. SELECT COUNT(*) FROM STUDENT;

7. SELECT AVG(Marks) FROM STUDENT;

8. SELECT MAX(Marks) FROM STUDENT;

9. SELECT MIN(Marks) FROM STUDENT;

10. SELECT City, COUNT(*) FROM STUDENT GROUP BY City;

11. INSERT INTO STUDENT VALUES(1,'Riya',20,88,'Mumbai');

12. UPDATE STUDENT SET Marks=90 WHERE RollNo=1;

13. DELETE FROM STUDENT WHERE Marks<40;

14. SELECT DISTINCT City FROM STUDENT;

15. SELECT * FROM STUDENT WHERE Name LIKE 'A%';

You might also like