Skip to content

Instantly share code, notes, and snippets.

@GabrielCzar
Last active May 27, 2018 00:34
Show Gist options
  • Save GabrielCzar/5f801eb8b117bba657316d076dc2f692 to your computer and use it in GitHub Desktop.
Save GabrielCzar/5f801eb8b117bba657316d076dc2f692 to your computer and use it in GitHub Desktop.
Criando novas colunas a partir de uma com pandas
  • Entrada
id Location
0 UK ~ London~East London ~ Mile End
1 UK ~ London~East London ~ Shadwe
  • Comando:
XlocTree = pd.DataFrame(df_location_tree.rel.str.split('~', 3).tolist(), columns = ['ABBR','City','Region', 'Local'])
  • Saida
id ABBR City Region Local
0 UK London East London Mile End
1 UK London East London Shadwe
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment