I have a pandas series that contains an array for each element, like so:
0 [0, 0]
1 [12, 15]
2 [43, 45]
3 [9, 10]
4 [0, 0]
5 [3, 3]
6 [0, 0]
7 [0, 0]
8 [0, 0]
9 [3, 3]
10 [2, 2]
I want to extract all the first elements, put them in another Series or list and do the same for the second element. I've tried doing regular expression:
mySeries.str.extract(r'\[(\d+), (\d+)\]', expand=True)
and also splitting:
mySeries.str.split(', ').tolist())
both give nan values. What am I doing wrong?