Skip to content

Instantly share code, notes, and snippets.

@Hugovdberg
Created September 23, 2019 13:10
Show Gist options
  • Select an option

  • Save Hugovdberg/cc17f0aaecc267a71b33fe99dff23c67 to your computer and use it in GitHub Desktop.

Select an option

Save Hugovdberg/cc17f0aaecc267a71b33fe99dff23c67 to your computer and use it in GitHub Desktop.
import pandas as pd
tellerstanden = pd.read_excel('Tellerstanden_PIAF.xlsx', sheet_name='Blad3')
tellerstanden = tellerstanden.melt(id_vars=['datum '], var_name='tagcode', value_name='waarde')
tellerstanden.columns = ['datum', 'tagcode', 'waarde']
tellerstanden.to_excel('Tellerstanden_PIAF_long.xlsx', index=False)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment