Sep-21-2019, 12:36 PM
Hi guys.
Hope you can help
I need to split my tuples into separate columns. This is what I got
Have a good day :)
Hope you can help
I need to split my tuples into separate columns. This is what I got
import csv with open('geyserData.csv', 'r') as f: reader = csv.reader(f) your_list = tuple(reader) eruption, waiting = zip(*your_list)What I need is to have the split with eruptions and waiting, without the row number
(['eruptions', 'waiting'], ['1', '3.600', '79'], ['2', '1.800', '54'], ['3', '3.333', '74'], ['4', '2.283', '62'], ['5', '4.533', '85'], ['6', '2.883', '55'], ['7', '4.700', '88'], ['8', '3.600', '85'],Instead, it returns this when using eruption and waiting
('eruptions', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12',
('waiting', '3.600', '1.800', '3.333', '2.283', '4.533', '2.883', '4.700', '3.600', '1.950', '4.350', '1.833', '3.917', '4.200', '1.750', '4.700', '2.167', '1.750', '4.800',How can I make it return it so index is not used? In my mind, I thinking I should enter the tuple by index and use [1] and [2]. Hope it makes sense :( Can you help?
Have a good day :)