Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@sid321axn
Created August 19, 2020 09:33
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/ff2d6b78c926d0621b0ca654cc7a67db to your computer and use it in GitHub Desktop.
Save sid321axn/ff2d6b78c926d0621b0ca654cc7a67db to your computer and use it in GitHub Desktop.
def digit_count(url):
digits = 0
for i in url:
if i.isnumeric():
digits = digits + 1
return digits
df['count-digits']= df['url'].apply(lambda i: digit_count(i))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment