test_dataframe
test_dataframe
7. How does dataframe assign row index to its rows in two dimensional dictionaries?
import pandas as pd
import numpy as np
s = pd.Series(5, index=[10, 11, 12, 13])
print(s)
9. 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.
10. Write a code statement to list the value of a cell in the 5 th row and "item" column from a dataframe
"sales"
11. Write a python statement to create (i) empty series (ii) empty dataframe
12. What is the difference between iloc and loc with respect to dataframe?
13. Write a small python code to drop a row from dataframe labeled as 0.
14. A dataframe studdf stores data about the students stream, marks. A part of it is shown below:
Class Stream Marks
11 Science 95
11 Commerce 80
11 Arts 75
11 Vocational 65
Using the above dataframe, write the command to compute Average marks stream wise.