Feb-07-2019, 02:35 AM
Hi
I am trying to look through a data set for a particular string name "s" and create another column with the value y1, y2, y3, etc for each cluster of "s". I will then create a new data set by summing the time for y1, y2, y3, etc. I am new to Python so I am struggling on how to start. I feel like itertools might be what I need. I appreciate any help.
Time (min) String New Column
2 s y1
4 s y1
2 s y1
3 x
3 x
5 x
6 s y2
2 s y2
4 s y2
I am trying to look through a data set for a particular string name "s" and create another column with the value y1, y2, y3, etc for each cluster of "s". I will then create a new data set by summing the time for y1, y2, y3, etc. I am new to Python so I am struggling on how to start. I feel like itertools might be what I need. I appreciate any help.
Time (min) String New Column
2 s y1
4 s y1
2 s y1
3 x
3 x
5 x
6 s y2
2 s y2
4 s y2