I have a list of lists of which I am trying to iterate through every element. The list looks like this:
lsts = [['2020', '2019', '2018'], ['iPhone (1)', '$', '137781', '$', '142381', '$', '164888'], ['Mac (1)', '28622']]
My attempt to remove only single numbers using re
from each element was as such:
new_lst = [re.sub('[0-9]{1}', '', ele) for ele in lst for lst in lsts]
However I get the following error:
NameError: name 'lst' is not defined
I was under the impression that this should work or is it not possible?
Thanks