Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- |code| |name|
- 001 Australia
- 002 London
- ...
- 001 <blank>
- code_names = [ "",
- 'Economic management',
- 'Public sector governance',
- 'Rule of law',
- 'Financial and private sector development',
- 'Trade and integration',
- 'Social protection and risk management',
- 'Social dev/gender/inclusion',
- 'Human development',
- 'Urban development',
- 'Rural development',
- 'Environment and natural resources management'
- ]
- df_copy = df_.copy()
- # Looks through each code name, and if it is empty, stores the proper name in its place
- for x in range(len(df_copy.mjtheme_namecode)):
- for y in range(len(df_copy.mjtheme_namecode[x])):
- if(df_copy.mjtheme_namecode[x][y]['name'] == ""):
- df_copy.mjtheme_namecode[x][y]['name'] = code_names[int(df_copy.mjtheme_namecode[x][y]['code'])]
- limit = 25
- counter = 0
- for x in range(len(df_copy.mjtheme_namecode)):
- for y in range(len(df_copy.mjtheme_namecode[x])):
- print(df_copy.mjtheme_namecode[x][y])
- counter += 1
- if(counter >= limit):
- break
Add Comment
Please, Sign In to add comment