Functions for displaying summary statistics and frequencies
During the first few days of working with a DataFrame, we try to get a good sense of the distribution of continuous variables and counts for categorical variables. We also often do counts by selected groups. Although pandas and NumPy have many built-in methods for these purposes—describe
, mean
, valuecounts
, crosstab
, and so on—data analysts often have preferences for how they work with these tools. If, for example, an analyst finds that they usually need to see more percentiles than those generated by describe
, they can use their own function instead. We will create user-defined functions for displaying summary statistics and frequencies in this recipe.
Getting ready
We will be working with the basicdescriptives
module again in this recipe. All of the functions we will define are saved in that module. We will continue to work with the NLS data.
How to do it...
We will use functions we create...