Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # from short to long format
- table_2012.melt(id_vars = "Country", value_vars = ["Gold", "Silver", "Bronze"], var_name="Medal", value_name="Count")
- pivot.melt(id_vars= 'model_year', value_vars= ['europe', 'japan', 'usa'], var_name = 'origin', value_name = 'mpg')
- #################################################################################################################
- # from long to short format
- melt_2012.pivot(index = "Country", columns = "Medal", values = "Count").sort_values("Gold", ascending = False)
- pivot = mean_mpg.pivot(index = "model_year", columns = "origin", values = "mpg")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement