Class XII IP October Test

 


 

 

Roll

Name

Class

Marks

0

1

Ravi

10

400

1

2

Kavi

11

300

2

3

Amit

12

200

3

4

Ajay

9

150

4

5

Raj

10

230

5

6

Umesh

12

250

 

Write Python statement for the following

1. Write code to create above dataframe with name df.

2. Print the last two rows of the ddataframe df.

3. Display all the roll.

4. Remove the column Class.

5. Display the data of name column from indexes 3 to 5 (both included)

6. Rename the column name ‘Marks’ to ‘Total’.

7. Write Python statement to add a new column city  with values.

8. Write Python statement to export the DataFrame to a CSV file named data.csv stored at D: drive.

9. Write suitable python statement to fetch the data from 'Quarterly_Sales.csv' into the dataframe  sales stored at C: drive.

10. Change the marks of Raj to a new value 500.

 

 

Comments