Created
July 30, 2014 14:22
-
-
Save cigrainger/8ea5842e9773e57cbdfe to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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