Skip to content

Instantly share code, notes, and snippets.

@jiobu1
Created April 28, 2021 15:10
Show Gist options
  • Save jiobu1/c0ea9ba15b86c3c7f065f804b120bc56 to your computer and use it in GitHub Desktop.
Save jiobu1/c0ea9ba15b86c3c7f065f804b120bc56 to your computer and use it in GitHub Desktop.
transform dataframe
population_melt = (population.melt(id_vars=['City,State'],
var_name = 'ds',
value_name = 'y'
).reset_index(drop=True)
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment