March 2020
Beginner to intermediate
352 pages
8h 40m
English
We have already discussed several ways in which we can group columns and rows using the pandas dataframe in Chapter 6, Grouping Dataset. In this section, we will use the same technique to group different columns together:
subset_attr = ['alcohol', 'density', 'pH', 'quality']low = round(df_wines[df_wines['quality_label'] == 'low'][subset_attr].describe(), 2)medium = round(df_wines[df_wines['quality_label'] == 'medium'][subset_attr].describe(), 2)high = round(df_wines[df_wines['quality_label'] == 'high'][subset_attr].describe(), ...
Read now
Unlock full access