You are on page 1of 2

Sarvodaya Public School Python Questions with Answer

Azamgarh By Ashraf Jamal

Q1-What is the use of pipe() function in Python Pandas?


Ans- . It does the chaining of functions in the order they are executed.
Q2-What is a DataFrame?
Ans- It is a two dimensional labelled array like, pandas data structure that stores
an ordered collection of columns that can store data of different types.

Q3-What is Quartile? How is it related to Quantile ?


Ans- Quartiles Q1, Q2, Q3 are three points that divide a distribution into 4 parts.
The 4 Quantiles are called Quartiles. Quartiles are multiples of 0.25, while
Quantiles need not to be.
Q4- What is Pyplot ?
Ans: Pyplot is a module in matplotlib, which supports a very wide
variety of graphs and plots namely -histogram,barcharts,power
spectra,error charts etc.
Q5-Which function is used to sort a DataFrame ?
Ans:
Sorting -dataframe
Sorting means arranging the contents in ascending or descending
order.There are two kinds of sorting available in pandas(Dataframe).
1.By value(column)
2.By index

1. By value -Sorting over dataframe column/s elements is supported by


sort_values() method. We will cover here three aspects of sorting
values of dataframe.
•Sort a pandas dataframe in python by Ascending and Descending
•Sort a python pandas dataframe by single column
•Sort apandas dataframe by multiple columns.
2. By index -Sorting over dataframe index sort_index()
Sarvodaya Public School Python Questions with Answer
Azamgarh By Ashraf Jamal

Q6- What is pivoting ? What is the shortcoming of pivot function?


Ans- Data pivoting is a summarizing technique to rearrange the columns and
rows in a report so as to view data from different perspective.
Pivot() gives error if there are multiple entries for a column value for the same
values for index(row)
Q7-Explain following terms of NumPy arrays
i) Rank ii) Shape iii) ItemSize
Ans:
(i)Rank: In a NumPy array, dimensions are called axes. The number of axes is called rank.
(ii) shape dimensions of a NumPy array .
(iii) itemsize the length of each element of array in bytes.

You might also like