Dec-21-2017, 03:21 PM
I am new to python and I have a csv file of the following type
id, header1, header2
1, 80-80-20, a
2, 30,b
3,,c
4,60-20,d
Now I would like to separate the values in
id, header1, header2, header1_1, header1_2, header1_3
1, 80-80-20, a, 80,80,20
2, 30,b,30,,
3,,c,,,
4,60-20,d,60,20,
Any hints on how to solve this using python 3?
id, header1, header2
1, 80-80-20, a
2, 30,b
3,,c
4,60-20,d
Now I would like to separate the values in
header1
to new columns where the -
is the "delimiter", i.e. it should look like this:id, header1, header2, header1_1, header1_2, header1_3
1, 80-80-20, a, 80,80,20
2, 30,b,30,,
3,,c,,,
4,60-20,d,60,20,
Any hints on how to solve this using python 3?