0% found this document useful (0 votes)
13 views1 page

DH Using Pandas-1 VSAQs

assignment on python pandas

Uploaded by

Samaira Gaba
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views1 page

DH Using Pandas-1 VSAQs

assignment on python pandas

Uploaded by

Samaira Gaba
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

DATA HANDLING USING PANDAS –1

VERY SHORT ANSWER QUESTIONS

for data analysis


1. What is the significance of Pandas library?

2. Name some common data structures of python’s pandas library? series and dataframe

3. Which platform is required to work on DataFrame?


Python
1) Used for data analysis
4. Mention four features of Pandas. 2) 1d and 2d representation of data
3) homogeneous and heterogeneous
5.
+ Name four common types of quantiles. 4) organize data in a structured way
***

6. Give two types of Sorting in Pandas DataFrame.


***

7. What will the output produced by following code”


Stationary = [‘pencils’, ‘notebooks’, ‘scales’, ‘erasers’]
S=pd.series([20,30,52,10],index=stationary)
S2=pd.series([17,13,32,21),index=stationary)
print(S+S2)
S=S+S2 37,43, 84,31
print(S+S2)

8. Find the error in following code fragment: import pandas as pd


S2=pd.Series([101,102,102,104]) S2=pd.Series([101,102,102,104])
S2.index=[0,1,2,3,4,5] S2.index=[0,1,2,3,4]
S2[5]=220 S2[5]=220
print(S2) print(S2)

9. How does dataframe assign row index to its rows in two dimensional dictionaries? df.index

10. What will be the output for the below program?


import pandas as pd
import numpy as np
s = pd.Series(5, index=[10, 11, 12, 13])
print(s)

11. Consider the following python code and write the output for statement S1
import pandas as pd
K=pd.Series([2,4,6,8,10,12,14])
K.quantile([0.50,0.75]) #Statement – S1

12. 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.

13. Write a code statement to list the value of a cell in the 5 th row and "item" column from a dataframe
"sales"

14. Write a python statement to create (i) empty series (ii) empty dataframe

15. What is the difference between iloc and loc with respect to dataframe?

16. Write a small python code to drop a row from dataframe labeled as 0.

17. 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.

You might also like