Skip to content
Advertisement

Python rows and columns arrangment

I have this below data file and I want three columns with heading “TIMESTEP”, “id” and “mass”.

Its corresponding values are just immediately below itenter image description here. How to do it. Please help

Below link 1 is my snapshot of data file and 2 is my desired arrangement.

Advertisement

Answer

I agree with the comments that the question is hard to understand, but from my understanding of your problem I have found this solution:

JavaScript

Try to run this script and see if this is what you were looking for.

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement