I have a text file and want to turn it into a pandas dataframe. Unfortunately, the structure of the text file makes this quite hard for me.
The text-file looks like this:
======> EVENT:130
a = 1.4
b = 2.5
c = 1.7
======> EVENT:698
a = 1.2
b = 4.3
c = 2.4
======> EVENT:1055
a = 3.4
b = 4.5
c = 2.3
The number after "EVENT:" is random. I would like to turn this text-file into a pandas dataframe with the following structure
a b c
1.4 2.5 1.7
1.2 4.3 2.4
3.4 4.5 2.3
So I want every Event in one row of the dataframe. How can I delete the "======> EVENT:xxxx" lines? Or how can I use this line to tell pd.read_csv() to start a new row in the df? And is there a way to make pd.read_csv() realize that on the left side of "=" is the column name and on the right side the entry for that column?