0% found this document useful (0 votes)
10 views43 pages

Shivansh Rawat IP Practical File XII

The document is a practical file for Informatics Practices by Shivansh Rawat, detailing various Python programming tasks related to data manipulation using Series and DataFrames, as well as data visualization with Matplotlib. It includes exercises on creating and modifying Series and DataFrames, performing mathematical operations, and executing SQL queries on employee and job tables. Each section outlines specific tasks, expected inputs, and outputs for the programs.

Uploaded by

heyy.shivo
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)
10 views43 pages

Shivansh Rawat IP Practical File XII

The document is a practical file for Informatics Practices by Shivansh Rawat, detailing various Python programming tasks related to data manipulation using Series and DataFrames, as well as data visualization with Matplotlib. It includes exercises on creating and modifying Series and DataFrames, performing mathematical operations, and executing SQL queries on employee and job tables. Each section outlines specific tasks, expected inputs, and outputs for the programs.

Uploaded by

heyy.shivo
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/ 43

INFORMATICS

PRACTICES
PRACTICAL FILE

NAME-SHIVANSH RAWAT
CLASS-XII-F
ROLL NO.-47

SHIVANSH RAWAT
XII-F
SERIES
1. To write a Python program to create a Series to store 5 students
Percentage Using dictionary and print all the elements that are
above 75 percentage.
INPUT :

OUTPUT :

SHIVANSH RAWAT
XII-F
2. To write a Python program to create a Series object that stores
the Initial budget allocated (50000/- each) for the four quarters of
the year: Qtr1, Qtr2, Qtr3 and Qtr4.
INPUT :

OUTPUT :

SHIVANSH RAWAT
XII-F
3. To write a Python program to create a Series object that stores
the Employee names as index and their Salary as values.
INPUT :

OUTPUT :

SHIVANSH RAWAT
XII-F
4. To Write a Python program to create a Series object with
Employee names as the index and their salaries as values. Accept
the name of the employee whose salary needs to be changed, along
with the new salary, and update it in the Series.
INPUT :

OUTPUT :

SHIVANSH RAWAT
XII-F
5. To create a program in python to perform following
mathematical Operations on Two Series objects:
(i) Addition (ii) Subtraction (iii) Multiplication (iv) Division
INPUT :

SHIVANSH RAWAT
XII-F
OUTPUT :

SHIVANSH RAWAT
XII-F
6. To write a Python program to create two series i.e. population
and average income of Four Zones, and then calculate per capita
income storing in third pandas series print it.
INPUT :

OUTPUT :

SHIVANSH RAWAT
XII-F
7. To write a Python program to create a Series using list and display
the following attributes of the Series:
(i) index (ii) dtype (iii) size (iv) shape (v) hasnans
INPUT :

SHIVANSH RAWAT
XII-F
OUTPUT :

SHIVANSH RAWAT
XII-F
8. To write a Python program to create a Series using list of Marks
of 10 students and display first 5 Students’ marks and Last 2
Students’ marks from Series object.
INPUT :

OUTPUT :

SHIVANSH RAWAT
XII-F
DATAFRAME
9. To write a Python program to create a panda’s Data Frame for the
following table Using Nested list

INPUT :

OUTPUT :

SHIVANSH RAWAT
XII-F
10. To write a Python program to create a panda’s DataFrame called
DF for the following table Using Dictionary of List and perform the
following operations:

(i) To Display only column 'Toys' from DataFrame DF.


(ii) To Display the row details of 'AP' and 'OD' from DataFrame
DF.
(iii) To Display the column 'Books' and 'Uniform' for 'M.P' and
'U.P' from DataFrame DF.
(iv) To Display consecutive 3 rows and 3 columns from
DataFrame DF.

SHIVANSH RAWAT
XII-F
INPUT :

SHIVANSH RAWAT
XII-F
OUTPUT :

SHIVANSH RAWAT
XII-F
11. To write a Python program to create a panda’s DataFrame called
DF for the following table Using Dictionary of List and perform the
following operations:
(i) Insert a new column “Bags” with values as [5891, 8628, 9785,
4475].
(ii) Delete the row details of M.P from DataFrame DF.
INPUT :

SHIVANSH RAWAT
XII-F
OUTPUT :

SHIVANSH RAWAT
XII-F
12. To write a Python program to create a pandas DataFrame to
analyze number of Government and Private medical college and
their Total seats,Fees statewise details using the dataset available at
www.data.gov.in. Also, perform the following operations.
(i) To Change the name of the state AP to Andhra.
(ii) To Count and Display Non-NaN values of each column.
(iii) To Count and Display Non-NaN values of each row.
(iv) To Increase the fees of all colleges by 5% Page 3 of 6
(v) To Replace all NaN values with 0
INPUT :

SHIVANSH RAWAT
XII-F
OUTPUT :

SHIVANSH RAWAT
XII-F
13. To write a Python program to create a panda’s DataFrame called
DF for the following table using Dictionary of List and display the
details of students whose Percentage is more than 85.

INPUT :

SHIVANSH RAWAT
XII-F
OUTPUT :

SHIVANSH RAWAT
XII-F
14. To write a Python program to create a DataFrame using
Dictionary of list and display the following attributes of the
DataFrame:
(i) index (ii) columns (iii) axes (iv) dtypes (v) shape (vi) dimension
INPUT :

SHIVANSH RAWAT
XII-F
OUTPUT :

SHIVANSH RAWAT
XII-F
15. To write a Python program to create a panda’s DataFrame called
Students for the following table and demonstrate iterrows and
iteritems.
INPUT :

OUTPUT :

SHIVANSH RAWAT
XII-F
16. To Write a Python program to store the details of Employess’
such as Empno, Name, Salary into a Employee.csv file. Also, write a
code to read employee details from csv file.
INPUT :

OUTPUT :

SHIVANSH RAWAT
XII-F
PROGRAMS USING MATPLOTLIB-DATA VISUALIZATION
17. To write a Python program to plot a Line chart to depict the
changing weekly Onion and Brinjal prices for four weeks. Also, give
appropriate axes labels, title and keep marker style as Diamond and
marker edge color as ‘red’ for Onion.
INPUT :

OUTPUT :

SHIVANSH RAWAT
XII-F
18. To write a Python program to create a DataFrame for subject-
wise average, save it to a CSV file, and then draw a bar chart using
Matplotlib with a width of each bar as 0.25, specifying different
colors for each bar. Additionally, provide a proper title and axes
labels for the bar chart.
INPUT :

OUTPUT :

SHIVANSH RAWAT
XII-F
19. To write a Python program to plot a multiple bar chart From CSV
file using Matplotlib for subject wise Scores of Class A, Class B, and
Class C. Different colors represent each class, and subjects include
English,Accountancy,Economics,BST and IP. Proper labels, a title and
a legend are displayed on the chart.
INPUT :

SHIVANSH RAWAT
XII-F
OUTPUT :

SHIVANSH RAWAT
XII-F
20. To write a Python program to plot a Histogram for the following
class interval or range. Also, give appropriate axes name, title and
edege color as ‘red’.
INPUT :

SHIVANSH RAWAT
XII-F
OUTPUT :

SHIVANSH RAWAT
XII-F
SQL
SQL Queries
21. With reference to the following relations (tables)
EMPLOYEE and JOB complete all the queries in your
practical file, Create following tables EMPLOYEE and JOB
Empno and Sno are not null and unique, name is never
blank, Area and Native place is valid, hobby, dept is not
empty.
TABLE: EMPLOYEE

TABLE : JOB

SHIVANSH RAWAT
XII-F
SHIVANSH RAWAT
XII-F
1. Show empno, name and salary of those who have Sports as
hobby.
OUTPUT :

2. Show name of the eldest employee.


OUTPUT :

3. Show number of employee area wise.


OUTPUT :

SHIVANSH RAWAT
XII-F
4. Show youngest employees from each Native place.
OUTPUT :

5. Show Sno, name, hobby and salary in descending order of salary.


OUTPUT :

6. Show the hobbies of those whose name pronounces as ‘Abhay’.


OUTPUT :

SHIVANSH RAWAT
XII-F
7. Show the appointment date and native place of those whose
name starts with ‘A’ or ends in ‘d’.
OUTPUT :

8. Show the salary expense with suitable column heading of those


who shall retire after 20-jan-2006.
OUTPUT :

9. Show an additional burden on the company in case the salary of


employees having a hobby as sports, is increased by 10%.
SHIVANSH RAWAT
XII-F
OUTPUT :

10. Show the hobby of which there are 2 or more employees.


OUTPUT :

11. Show how many employee shall retire today if maximum length
of service is 20 years.
OUTPUT :

12. Show those employee name and date of birth who have served
more than 17 years as on date.
OUTPUT :
SHIVANSH RAWAT
XII-F
13. Show names of those who earn more than all of the employees
of Sales dept.
OUTPUT :

14. Show names of those who earn more than at least one of the
employees of Marketing dept.
OUTPUT :

SHIVANSH RAWAT
XII-F
15. Increase salary of the employees by 5 % of their present salary
with hobby as Music or they have completed atleast 3 years of
service.
OUTPUT :

16. Show the maximum salary and the hobby of employee.


OUTPUT :

SHIVANSH RAWAT
XII-F
17. Count the number of employees in each department.
OUTPUT :

18. To display the maximum, minimum, sum and average salary of


each department.
OUTPUT :
SHIVANSH RAWAT
XII-F
19. To display ename in lower case and job in upper case.
OUTPUT :

20. To display employees name, salary and Area of all the


employees working in Agra.
OUTPUT :

SHIVANSH RAWAT
XII-F
21. Add a new tuple(row) in the table essentially with hobby as
Music.
OUTPUT :

22. Insert a new column email in job table


OUTPUT :

23. Create a table with values of columns empno, name, and hobby.
OUTPUT :

SHIVANSH RAWAT
XII-F
24. Erase the records of employee from job table whose hobby is
not Sports.
OUTPUT :

25. Remove the table EMPLOYEE.

SHIVANSH RAWAT
XII-F

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy