Skip to content

Instantly share code, notes, and snippets.

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