Download Practical File Informatics Practices Class 12 A comprehensive guide

This article, Practical File Informatics Practices Class 12 A comprehensive guide will provide you with practical file solutions. As per the syllabus of the session 2023-24, the board practical exam for Informatics Practices class 12 will be 30 marks. So in this article, you will get complete information for Practical File Informatics Practices Class 12. So let’s begin now!

Practical File Informatics Practices Class 12

As per the syllabus of the session 2022-23, the distribution of practical examinations will be something like the following where Practical File Informatics Practices Class 12 is one of the components of the practical exam.

S.NoTopicMarks
1Programs Using Pandas and Matplolib8
2SQL Queries7
3Practical file:
**minimum of 15 programs based on Pandas
**4 programs based on Matplotlib
**15 SQL queries must be included
5
4Project Work (using concepts learned in class XI and XII)5
5Viva5
Total30
distribution of practical marks for class 12 informatics practices 2023

How do I create Practical File Informatics Practices Class 12

To create the Practical File Informatics Practices Class 12, you can use the suggested practical programs in the curriculum. There is a total of 9 programs given in this suggested practical list. As per the distribution of marks of practical, it demands 15 pandas programs and 4 programs on matplotlib. So you can add 6 more programs to the list and write code along with the output.

The practical file can be created by handwritten practical journals or a printed copy of programs attached to the file. You can confirm with your school teacher and do it accordingly. I will provide you with one sample copy for Practical File Informatics Practices Class 12.

Practical Questions for Practical File Informatics Practices Class 12

In the first part of practical questions for Practical File Informatics Practices Class 12, I will cover data handling using pandas I topic. First, we will see the list of programs suggested by CBSE. So here we go!

Suggested practical list by CBSE for data handling

  1. Create a panda’s series from a dictionary of values and a ndarray.
  2. Given a Series, print all the elements that are above the 75th percentile.
  3. Create a Data Frame for quarterly sales where each row contains the item category, item name,
    and expenditure. Group the rows by category and print the total expenditure per category.
  4. Create a data frame for examination results and display row labels, column labels data types of
    each column, and the dimensions
  5. Filter out rows based on different criteria such as duplicate rows.
  6. Importing and exporting data between pandas and CSV file.

Suggested practical list by CBSE for data visualization

  1. Given the school result data, analyze the performance of the students on different parameters,
    e.g subject wise or class-wise.
  2. For the Data frames created above, analyze, and plot appropriate charts with title and legend.
  3. Take data of your interest from an open source (e.g. data.gov.in), aggregate and summarize it.
    Then plot it using different plotting functions of the matplotlib library.

Suggested practical list by CBSE for Data management

  1. Create a student table with the student id, name, and marks as attributes where the student id is the primary key.
  2. Insert the details of a new student in the above table.
  3. Delete the details of a student in the above table.
  4. Use the select command to get the details of the students with marks more than 80.
  5. Find the min, max, sum, and average of the marks in a student marks table.
  6. Find the total number of customers from each country in the table (customer ID, customer Name, country) using group by.
  7. Write a SQL query to order the (student ID, marks) table in descending order of the marks.

The complete Practical File Informatics Practices Class 12 with code and output

So in addition to the suggested practical list by CBSE, you need to add 6 more programs for Practical File Informatics Practices Class 12. So here I will add them. I have changed some programs from that list.

[1] Write a program to generate a series of float numbers from 41.0 to 60.0 with an increment of 2.5 each.

Solution:

import pandas as pd
import numpy as np
def fl_ser():
    n = np.arange(41,60,2.5)
    s = pd.Series(n)
    print(s)
fl_ser()

The Output is:

Output Program Term 1 Practical File IP Class 12
Output Program Term 1 Practical File IP Class 12

[2] Write a program to generate a series of 10 numbers with a scalar value of 44.

Solution:

import pandas as pd
def fl_scv():
    print(pd.Series(44,range(1,11)))
fl_scv()
Download Practical File Informatics Practices Class 12 A comprehensive guide
The output of program 2 term 1 practical file IP class 12

[3] Create a panda’s series from a dictionary of values and a ndarray.

Solution:

import pandas as pd
import numpy as np
def pro3():
    #Creating series from a dictionary
    d={'Jan':31,'Feb':28,'Mar':31,'Apr':30}
    s=pd.Series(d)
    print("Series from dictionary")
    print("~~~~~~~~~~~~~~~~~~~~~~~")
    print(s)
    #Creating series from an ndarray
    ar=np.array([2,3,4,5,6])
    print("\nSeries from ndarray")
    print("~~~~~~~~~~~~~~~~~~~~~~~")
    s1=pd.Series(ar)
    print(s1)
pro3()
series from dictionary and ndarray
series from dictionary and ndarray

[4] Given a Series, print all the elements that are above the 75th percentile.

Solution:

import pandas as pd
def Ser_stumarks():
    std_marks = []
    for i in range(1,6):
        m = int(input("Enter the Percentile:"))
        std_marks.append(m)
    s = pd.Series(index=range(1201,1206),data=std_marks)
    print("Data fetched from the series are:")
    print(s[s>=75])
Ser_stumarks()
Output of Program4 Term 1 practical file ip class 12
Output of Program4 Term 1 practical file ip class 12

Follow the below-given link to see more practical questions and solutions that help you in preparing Term 1 Practical File IP Class 12:

Practice Questions on Python Pandas I – (Series)

[5] Create a data frame for examination results and display row labels, column labels data types of each column and the dimensions.

Solution:

import pandas as pd
def df_std_res():
    res={'Amit':[76,78,75,66,68],
        'Shialesh':[78,56,77,49,55],
        'Rani':[90,91,93,97,99],
        'Madan':[55,48,59,60,66],
        'Radhika':[78,79,85,88,86]}
    df=pd.DataFrame(res)
    print("Prinitng row labels in a list:")
    print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~")
    idx=df.index
    l=list(idx)
    print(l)
    print("Prinitng row labels in a list:")
    print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~")
    print("[",end=" ")
    for col in df.columns:
        print(col,end=" ")
    print("]")
    print("Printing Data Types of each column")
    print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~")
    print(df.dtypes)
    print("Printing dimensions of Data Frame")
    print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~")
    print(df.ndim)
df_std_res()
Ouptut

[6] Create a dataframe and iterate them over rows.

Solution:

import pandas as pd 

data = [["Virat",55,66,31],["Rohit",88,66,43],[
         "Hardik",99,101,68]]

players = pd.DataFrame(data,
          columns = ["Name","Match-1","Match-2","Match-3"])

print("Iterating by rows:")
print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~")
for index, row in players.iterrows():
    print(index, row.values)


print("Iterating by columns:")
print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~")
for index, row in players.iterrows():
    print(index, row["Name"],row["Match-1"],
          row["Match-2"],row["Match-3"])

iterrows in dtaframe class 12
iterrows in dtaframe class 12

[7] Create a dataframe and print it along with their index using iteritems().

import pandas as pd
def df_operations():
    sc_4yrs={2016:{'Virat Kohli':2595,'Rohit Sharma':2406,'Shikhar Dhawan':2378},
         2017:{'Virat Kohli':2818,'Rohit Sharma':2613,'Shikhar Dhawan':2295},
         2018:{'Virat Kohli':2735,'Rohit Sharma':2406,'Shikhar Dhawan':2378},
         2019:{'Virat Kohli':2455,'Rohit Sharma':2310,'Shikhar Dhawan':1844}}
    df=pd.DataFrame(sc_4yrs)
    print(df)
    print("------------------------------------------------------------------------")
    for (year,runs) in df.iteritems():
        print("Year:",year)
        print(runs)
df_operations()
iteritems in dataframe class 12 ip
iteritems in dataframe class 12 ip

[8] 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.

2018201920202021
Kapil110205177189
Kamini130165175190
Shikhar115206157179
Mohini118198183169
  1. Create the DataFrame.
  2. Display the row labels of Sales.
  3. Display the column labels of Sales.
  4. Display the data types of each column of Sales.
  5. Display the dimensions, shape, size and values of Sales.
import pandas as pd
#Creating DataFrame
d = {2018:[110,130,115,118],
     2019:[205,165,175,190],
     2020:[115,206,157,179],
     2021:[118,198,183,169]}
sales=pd.DataFrame(d,index=['Kapil','Kamini','Shikhar','Mohini'])
#Display row lables
print("Row Lables:\n",sales.index)
print("~~~~~~~~~~~~~~~~~~~~~~~~~~\n")
#Display column lables
print("Column Lables:\n",sales.columns)
print("~~~~~~~~~~~~~~~~~~~~~~~~~~\n")
#Display data type
print("\nDisplay column data types")
print("~~~~~~~~~~~~~~~~~~~~~~~~~~")
print(sales.dtypes)
print("\nDisplay the dimensions, shape, size and values of Sales")
print("~~~~~~~~~~~~~~~~~~~~~~~~~~")
print("Dimensions:",sales.ndim)
print("Shape:",sales.shape)
print("Size:",sales.size)
print("Values:",sales.values)

[9] Consider above dataframe and write code to do the following:

  1. Display the last two rows of Sales.
  2. Display the first two columns of Sales.
import pandas as pd
#Creating DataFrame
d = {2018:[110,130,115,118],
     2019:[205,165,175,190],
     2020:[115,206,157,179],
     2021:[118,198,183,169]}
sales=pd.DataFrame(d,index=['Kapil','Kamini','Shikhar','Mohini'])
print("Display last two rows of DataFrame:")
print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~")

#Method 1
print("Using tail function:")
print(Sales.tail(2))

#Method 2
print("Using iloc")
print(Sales.iloc[-2:])

#With Specific Columns, I have prnted two columns
print("Sepcific Columns")
print(Sales.iloc[-2:,-2:])


print("Display first two columns of Dataframe:")
print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~")
#Method 1
print(Sales[[2014,2015]])

#Method 2
print(Sales[Sales.columns[0:2]])

#Method 3
print(Sales.iloc[:, 0:2] )

[10] Use above dataframe and do the following:

  1. Change the DataFrame Sales such that it becomes its transpose.
  2. Display the sales made by all sales persons in the year 2018.
  3. Display the sales made by Kapil and Mohini in the year 2019 and 2020.
  4. Add data to Sales for salesman Nirali where the sales made are
    • [221, 178, 165, 177, 210] in the years [2018, 2019, 2020, 2021] respectively
  5. Delete the data for the year 2018 from the DataFrame Sales.
  6. Delete the data for sales man Shikhar from the DataFrame Sales.
  7. Change the name of the salesperson Kamini to Rani and Kapil to Anil.
  8. Update the sale made by Mohini in 118 to 150 in 2018.

Solution:

import pandas as pd
#Creating DataFrame
d = {2018:[110,130,115,118],
     2019:[205,165,175,190],
     2020:[115,206,157,179],
     2021:[118,198,183,169]}
sales=pd.DataFrame(d,index=['Kapil','Kamini','Shikhar','Mohini'])
print("Transpose:")
print("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~")
print(sales.T)
print("\nSales made by each salesman in 2018")

#Method 1
print(sales[2018])

#Method 2
print(sales.loc[:,2018])

print("Sales made by Kapil and Mohini:")
#Method 1
print(sales.loc[['Kapil','Mohini'], [2019,2020]])

#Method 2
print(sales.loc[sales.index.isin(["Kapil","Mohini"]),[2019,2020]])

print("Add Data:")
sales.loc["Nirali"]=[221, 178, 165, 177]
print(sales)

print("Delete Data for 2018:")
sales=sales.drop(columns=2018)
print(sales)


Sales.drop(columns=2018,inplace=True)
print(Sales)

sales=sales.drop("Shikhar",axis=0)
#sales.drop("kinshuk")
print(sales)

sales=sales.rename({"Kamini":"Rani","Kapil":"Anil"},axis="index")
print(sales)

sales.loc[sales.index=="Mohini",2018]=150
print(sales)

If you are looking for more practice questions on data frame follow the below-given link that will definitely provide you support in making Term 1 Practical File IP Class 12:

Practical questions on Python Pandas I Data frame

[11] Plot the following data on a line chart and customize the chart according to the below-given instructions:

MonthJanuaryFebruaryMarchAprilMay
Sales510350475580600
Weekly Sales Report
  1. Write a title for the chart “The Monthly Sales Report
  2. Write the appropriate titles of both the axes
  3. Write code to Display legends
  4. Display blue color for the line
  5. Use the line style – dashed
  6. Display diamond style markers on data points
import matplotlib.pyplot as pp
mon =['January','February','March','April','May']
sales = [510,350,475,580,600]
pp.plot(mon,sales,label='Sales',color='b',linestyle='dashed',marker='D')
pp.title("The Monthly Sales Report")
pp.xlabel("Months")
pp.ylabel("Sales")
pp.legend()
pp.show()

Ouptut:

practical file questions matplotlib pyplot for class 12 IP
practical file questions matplotlib pyplot for class 12 IP

[12] Pratyush Garments has recorded the following data into their register for their income from cotton clothes and jeans. Plot them on the line chart.

DayMondayTuesdayWednesdayThursdayFriday
Cotton450560400605580
Jeans490600425610625

Apply following customization to the line chart.

  1. Write a title for the chart “The Weekly Garment Orders”.
  2. Write the appropriate titles of both the axes.
  3. Write code to Display legends.
  4. Display your choice of colors for both the lines cotton and jeans.
  5. Use the line style – dotted for cotton and dashdot for jeans.
  6. Display plus markers on cotton and x markers of jeans.
import matplotlib.pyplot as pp
day =['Monday','Tuesday','Wednesday','Thursday','Friday']
ct = [450,560,400,605,580]
js = [490,600,425,610,625]
pp.plot(day,ct,label='Cotton',color='g',linestyle='dotted',marker='+')
pp.plot(day,js,label='Food',color='m',linestyle='dashdot',marker='x')
pp.title("The Weekly Garment Orders")
pp.xlabel("Days")
pp.ylabel("Orders")
pp.legend()
pp.show()

Output:

Class 12 IP matplotlib pyplot 2
Class 12 IP matplotlib pyplot 2

[13] Observe the given data for monthly views of one of the youtube channels for 6 months. Plot them on the line chart.

MonthJanuaryFebruaryMarchAprilMayJune
Views250021001700350030003800

Apply the following customizations to the chart:

  1. Give the title for the chart – “Youtube Stats”
  2. Use the “Month” label for X-Axis and “Views” for Y-Axis.
  3. Display legends.
  4. Use dashed lines with the width 5 point.
  5. Use red color for the line.
  6. Use dot marker with blue edge color and black fill color.

The solution is available in the PDF.

[14] Observe following data and plot data according to given instructions:

Batsman2017201820192020
Virat Kohli2501185522031223
Steve Smith2340225020031153
Babar Azam1750214718961008
Rohit Sharma1463198518541638
Kane Williamson1256178518741974
Jos Butler1125185317691436
  1. Create a bar chart to display data of Virat Kohli & Rohit Sharma.
  2. Customize the chart in this manner
  1. Use different widths
  2. Use different colors to represent different years score
  3. Display appropriate titles for axis and chart
  4. Show legends
  5. Create a bar chart to display data of Steve Smith, Kane Williamson & Jos Butler. Customize Chart as per your wish.
  6. Display data of all players for the specific year.

[15] Write a program to plot a range from 1 to 30 with step value 4. Use the following algebraic expression to show data.y = 5*x+2

The solution is available in the PDF.

Watch this video for more clarity:

If you want few more programs on Data Visualization using python pandas follow the below-given link, these programs may help you in preparing your Practical File IP Class 12:

Python Pandas Data Visualization

Download the Practical File IP Class 12 in Word format

Download the Term 1 Practical File IP Class 12 from this link:

Download the Practical File IP Class 12 initial pages in Word format

Download the practical file IP Class 12

I hope you enjoyed this article, Practical File IP Class 12. Download the file and use it as a reference. If you have any concerns related to this article Term 1 Practical File IP Class 12 feel free to comment in the comment section.

Thank you for reading Term 1 Practical File IP Class 12.

One thought on “Download Practical File Informatics Practices Class 12 A comprehensive guide”

Leave a Reply