0

enter image description here

How to set a CSV like from the photo from pic 1 to pic 2 with pandas? How can I select every other/second row and put it in a new column so the result should be like in pic 2, so it make sense when you look at the data? Have in mind that csv have much more data then given in the photo. Like I have 3 million rows in one column in the CSV, and have to half it into two columns (pic2).

Fantom
  • 5
  • 4
  • Split the column in two with `df['col'].str.split(':', expand=True)` or add a new column with `np.arange(len(df))%2` and follow the recipe #10 in the duplicate. – mozway Nov 09 '22 at 09:07

0 Answers0