List of Programs For Informatics - XII - IP
List of Programs For Informatics - XII - IP
CODING:
1. Create a pandas series from a dictionary of values and
an ndarray.
Download
# create a dictionary
dictionary = {'X' : 10, 'Y' : 20, 'Z' : 30} # create
a series
series = pd.Series(dictionary)
print(series)
import pandas as pd
import csv
#Reading the Data
df = pd.read_csv("student_result.csv")
# Display Name of Columns
print(df.columns)
# Display no of rows and column
print(df.shape)
# Display Column Names and their types
print(df.info())
import pandas as pd
import csv
#To display Adm_No, Gender and Percentage from
‘student_result.csv’ file.
df = pd.read_csv("student_result.csv",usecols =
['ADM_NO','GENDER', 'PERCENTAGE'])
print("To display Adm_No, Gender and Percentage from
‘student_result.csv’ file.")
print(df)
#To display first 5 and last 5 records from
‘student_result.csv’ file.
df1 = pd.read_csv("student_result.csv")
print(df1.head())
print(df1.tail())
22. Given a Series, print all the elements that are above
the 75th percentile.
Download
# Given a Series, print all the elements that are
above the 75th percentile.
import pandas as pd
import numpy as np
s=pd.Series(np.array([2,4,5,10,18,20,25]))
print(s)
res=s.quantile(q=0.75)
print()
print('75th Percentile of the series is::')
print(res)
print()
print('The elements that above the 75th percentile:')
print(s[s>res])
27. For the Data frames created above, analyze, and plot
appropriate charts with title and legend.
• Number of Students against Scores in all the 7
subjects
• Show the Highest score of each subject
Download
28. For the Data frames created above, analyze, and plot
appropriate charts with title and legend.
• Show the Average score of each subject
Download
29. For the Data frames created above, analyze, and plot
appropriate charts with title and legend.
• Number of Females and Males
• Average Percentage of Females and Males
Download