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

Aissce Practical I.P 2020-21-1

The document provides instructions for an Informatics Practices practical exam consisting of two questions. Question 1 has subparts A through E asking to create dataframes from dictionaries, analyze student performance, and correct code to display the last four rows of a dataframe. Question 2 asks to write Python code to create a student table in MySQL with columns for roll number, name, class, date of birth, gender, city, and marks.

Uploaded by

Mayank Mishra
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)
912 views6 pages

Aissce Practical I.P 2020-21-1

The document provides instructions for an Informatics Practices practical exam consisting of two questions. Question 1 has subparts A through E asking to create dataframes from dictionaries, analyze student performance, and correct code to display the last four rows of a dataframe. Question 2 asks to write Python code to create a student table in MySQL with columns for roll number, name, class, date of birth, gender, city, and marks.

Uploaded by

Mayank Mishra
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/ 6

AISSC PRACTICAL EXAM

Subject: Informatics Practices Class:-XII Subject Code:-065

Time Allowed:-3.00 Hrs SET-1 Max Marks:-30

1. Solve any two from 1.A to 1.D (3.5+3.5)

A)Create a data frame for examination result and display row


labels, column labels data types of each column and the
dimensions.?
ANS
B) Write a program in Python Pandas to create the following
DataFrame df from Dictionary:

Quartar1 Quartar2 Quartar3 Quartar4


0 2000 5800 20000 1400
1 4000 2500 18000 3500
2 5000 5400 7050 1700
3 4000 3020 3600 2000
4 10000 2900 8200 6000

ANS
C) Given the school result data, analyse the performance of the
students on different parameters, e.g. subject wise or class
wise.?
ANS
D). Write the code in pandas to create two
dataframes df1 and df2 :

df1 df2
mark1 mark2 mark1 mar2
0 10 15 0 30 20
1 40 45 1 20 25
2 15 30 2 20 30
3 40 70 3 50 30
Write the commands to do the following operations on the
dataframes given above :
ANS
(i) To add dataframes df1 and df2

(ii) To subtract df2 from df1

E) Hitesh wants to display the last four rows of the dataframe


df and has written the following code : df.tail()
But last 5 rows are being displayed. Identify the error and
rewrite the correct code so that last 4 rows get displayed.
ANS df.tail(4)

2.Write Python code to create the table: STUDENT given below in MySql: (3)

TABLE-STUDENT
ROLL NO. NAME CLASS DOB GENDER CITY MARKS

1 NANDA X 06-06-1995 M AGRA 551

2 SAURABH XII 07-05-1993 M MUMBAI 462

3 SANAL XI 06-05-1994 F DELHI 400

4 TRISLA XII 08-08-1995 F MUMBAI 450

5 STORE XII 08-10-1995 M DELHI 369


ANS
import pandas as pd
import numpy as np
import mysql.connector as sqlt
db=sqlt.connect(host='localhost',user='root',
passwd='pppp',
database='mysql')
mycursor=db.cursor()
mycursor.execute("create table student(Rollno integer primary
key,Name varchar(10),Class varchar(3),DOB date,Gender
varchar(1),City varchar(20),Marks integer)")

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