Skip to content
Advertisement

Splitting single-columned .CSV into multiple columns with Pandas

I’m interested to know how to elegantly go about splitting a single-columned file of the following format into a more classic tabular layout using Pandas.

(The file is received as an output from an eye tracker.)

Current Format:

JavaScript

Desired Format:

JavaScript

Where I’m stuck: I imagine the solution will involve Pandas’ split method but I’m having trouble figuring out how to get there. I imagine I’ll have to “manually” add the respective columns while somehow splitting period-delimited rows of data…

JavaScript

I’d really appreciate some direction. Thanks in advance.

Advertisement

Answer

pandas.read_... has several usefull parameters to play with.

I believe you want something like this?

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