Skip to content

Instantly share code, notes, and snippets.

@cigrainger
Created July 30, 2014 14:22
Show Gist options
  • Save cigrainger/8ea5842e9773e57cbdfe to your computer and use it in GitHub Desktop.
Save cigrainger/8ea5842e9773e57cbdfe to your computer and use it in GitHub Desktop.
turnover.columns = [x[-4:] if x.startswith('turnover')
else x
for x in turnover.columns.values]
turnover = pd.melt(turnover,id_vars=['bvd_id'],var_name='year',value_name='turnover')
turnover.year = turnover.year.astype('int')
turnover.turnover = [np.nan if x == 'n.a.'
else x
for x in turnover.turnover]
turnover.turnover = [str(x).replace(',','') if x != np.nan
else x
for x in turnover.turnover]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment