Skip to content

Instantly share code, notes, and snippets.

@frankhn
Created March 24, 2020 09:20
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 frankhn/edeae81e7b34def3d11939808bd62a31 to your computer and use it in GitHub Desktop.
Save frankhn/edeae81e7b34def3d11939808bd62a31 to your computer and use it in GitHub Desktop.
name = 'German_shepherd_dog_04890.jpg'
name1= 'Boston_terrier_02303.jpg'
name2='Beagle_01170.jpg'
name3='Miniature_schnauzer_06884.jpg'
# label = name.rsplit('.', 1)[0]
label = ''.join([i for i in name2.rsplit('.', 1)[0] if not i.isdigit()]).replace("_", ' ').strip()
print label
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment