0% found this document useful (0 votes)
3 views

Ch 2 Python Pandas

The document outlines key functions and concepts related to Python Pandas, including descriptive statistics functions like min() and mean(), the use of the axis argument for row calculations, and definitions of quantiles and quartiles. It describes pivoting functions such as pivot() and pivot_table(), the purpose of the aggfunc argument, and the functionality of hist() for plotting histograms. Additionally, it mentions function-application functions like pipe() and groupby(), detailing when to use pipe() and the syntax for groupby().

Uploaded by

01kumatyt
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)
3 views

Ch 2 Python Pandas

The document outlines key functions and concepts related to Python Pandas, including descriptive statistics functions like min() and mean(), the use of the axis argument for row calculations, and definitions of quantiles and quartiles. It describes pivoting functions such as pivot() and pivot_table(), the purpose of the aggfunc argument, and the functionality of hist() for plotting histograms. Additionally, it mentions function-application functions like pipe() and groupby(), detailing when to use pipe() and the syntax for groupby().

Uploaded by

01kumatyt
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/ 1

CHECK POINT ANSWERS

CH – 2 PYTHON PANDAS
1. Name some descriptive statistic functions used with dataframes.
Some of the descriptive statistic functions used with dataframes:
min(), max(), mode(), mean(), median(), count(), sum(), quantile() and var()
2. To, calculate statistical values for each row, the axis argument’ should be _________?
The axis argument must be ‘0’ to calculate statistical values for each row.
3. What are quantile and quartiles?
a. Quantiles are points in a distribution that relate to the rank order of values in that distribution. The
quantile of the median is 0.5, by definition.
b. Quartiles are the multiples of 0.25, with three measures of spread i.e. the Lower Quartile (Q1),
Upper Quartile (Q2) and the Interquartile Range (IQR).
4. What does quantile() do?
The quantile() function returns the values at the given quantiles over requested axis.
5. Name pivoting functions available for dataframes.
Pivoting functions available for dataframes are:
a. pivot()
Syntax: <DataFrame>.pivot(index = <column name>, columns = <column name>, values = <column
name>)
b. pivot_table()
Syntax: <DataFrame>.pivot_table(index = , columns = , values = , aggfunc = )
6. What is the use of aggfunc argument in pivot_table( )?
The ‘aggfunc’ argument in the pivot_table() function contains the function as per which the data is to
be aggregated. By default it is mean.
7. What does hist( ) do?
The hist() function helps to plot a histogram and show the underlying frequency distribution of a set of
continuous data.
8. Name some function-application functions.
Some function-application functions are:
a. pipe()
b. apply()
c. applymap()
d. groupby()
e. transform()
9. When should pipe( ) be preferred over sandwiching of function call?
When there are more than two levels of sandwiching, then the pipe() function must be preferred.
10. What does groupby( ) do?
The groupby() function is used to group the data on the basis of a particular column or multiple
columns.
Syntax: <DataFrame>.groupby(by = , axis = )

You might also like