I have a long Python list like:
['A p=45 n=200 SNR=12', 'B p=2232 n=22 SNR=2']
I would like to get from this list a list of tuples containing the value of p, n and SNR.
So:
funz(['A p=45 n=200 SNR=12', 'B p=2232 n=22 SNR=2'])
would return:
[(45,200,12), (2232,22,2)]
The strings in the list have all the same structure.
[tuple(int(m) for m in re.findall(r'(\d+)', i)) for i in lst]