Skip to content

Instantly share code, notes, and snippets.

@NataliiaRastoropova
Last active May 16, 2019 08:35
Show Gist options
  • Save NataliiaRastoropova/d7785a50e91956803191e44e061b8361 to your computer and use it in GitHub Desktop.
Save NataliiaRastoropova/d7785a50e91956803191e44e061b8361 to your computer and use it in GitHub Desktop.
# Create pivot_table
colum_names = ['fixed acidity', 'volatile acidity', 'citric acid', 'residual sugar', 'chlorides', 'free sulfur dioxide', 'total sulfur dioxide', 'density', 'pH', 'sulphates', 'alcohol']
df_pivot_table = df.pivot_table(colum_names, ['quality'], aggfunc='median')
print(df_pivot_table)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment