Skip to content

Instantly share code, notes, and snippets.

@sid321axn
Created August 19, 2020 09:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sid321axn/b42c9d6de7d90dece4c998e12a37d67f to your computer and use it in GitHub Desktop.
Save sid321axn/b42c9d6de7d90dece4c998e12a37d67f to your computer and use it in GitHub Desktop.
def no_of_embed(url):
urldir = urlparse(url).path
return urldir.count('//')
df['count_embed_domian'] = df['url'].apply(lambda i: no_of_embed(i))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment