selecting strings with no digits fro a list python code example
Example 1: python get numbers from string
string = "abc123"
# Method 1
''.join(char for char in string if char.isdigit())
#Method 2
import re
re.sub("[^0-9]", "", string)
Example 2: extract numbers from list of strings python using regex
new_list = [int(item) for sublist in a for item in sublist if item.isdigit()]