Skip to content

Instantly share code, notes, and snippets.

@CharlyWargnier
Created February 8, 2020 16:45
Show Gist options
  • Save CharlyWargnier/a342673b79f78157aa95cc3e0037a90f to your computer and use it in GitHub Desktop.
Save CharlyWargnier/a342673b79f78157aa95cc3e0037a90f to your computer and use it in GitHub Desktop.
# Split IP addresses
df[['IP','header']] = df["header"].str.split(" - - \[", 1, expand=True)
# Remove slash
df['IP'] = df['IP'].str.replace("Row\(\('","",n=1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment