Practice assignment -1-Class XI AI
Practice assignment -1-Class XI AI
Q1. Write a program to create series from an array in Python with index starting from 1.
Q2. The ages of a group of people in a community are: 25, 28, 30, 35, 40, 45, 50, 55, 60, 65. Write a
program to calculate the mean, median, and mode of the ages.
Q3. Consider the following admission.csv and answer the following questions:
Ravi 10 M 57
Rashmi 11 F 78
Ramesh 10 M 72
Mohit 9 M 53
Manavi 10 F 47
Dhruv 9 M 76
a. Create a dataframe from the admission.csv
import pandas as pd
import csv
df=pd.read_csv(“admission.csv”)
print(df)
b.Display first 3 rows of the dataframe
print(df.head(3))
c.Display the details of Ravi
print(df . loc[‘Ravi’])
d.Display the total number of rows and columns in the data frame
print(df.shape)
e.Display the column “Gender”
print(df[‘Gender’])
Q4. Plot a line chart representing the weekly number of customer inquiries received by a customer
service center:
• Week 1: 150 inquiries
• Week 2: 170 inquiries
• Week 3: 180 inquiries
• Week 4: 200 inquiries
Q6. Akshith wrote a program to visualize the data analysis of five test and marks got. The program
did not have any errors. But the line graph was not showing up. Could you find the reason why the
graph is not shown even though the program has no errors?
Try it yourself
Q. Plot a bar chart representing the number of books sold by different genres in a bookstore:
• Fiction: 120 books
• Mystery: 90 books
• Science Fiction: 80 books
• Romance: 110 books
• Biography: 70 books