I have a string of coordinates stored in a sequence of tuples such as '(522, 187) (522, 187) (522, 191) (523, 188) (522, 190) (being stored in a deque first and then converted to string).
- How is it possible to transform this entity into a list/deque of tuples? So that it would look like
[(522, 187), (522, 187), (522, 191), (523, 188), (522, 190)]?
Simple splitting with split(',') doesn't work, as it then separates every coordinate due to ',' inside the tuple.
- Is there any more convenient way of storing a list/deque of tuples in a single cell of .csv file? I need to store all coordinates received from every trial in an individual cell. Making two columns with _x and _y coordinates sometimes results into unequal length of these arrays.