I have large data files (CSV type) that I read with pandas. Each files has a information column that has many names and numbers seperated by ;. Below how this column looks like:
0 Acid: 74.1 [°C];LeakRate [Bar/Min]: 103 ;P: ...
1 Acid: 73.9 [°C]; LeakRate [µBar/Min]: 371 ; ...
2 Acid: 73.9 [°C]; LeakRate [µBar/Min]: 107 ; ...
3 Acid: 73.9 [°C]; LeakRate [µBar/Min]: 371 ; ...
4 Acid: 74.0 [°C]; LeakRate [µBar/Min]: 107 ; ...
Name: Information, dtype: object
I use string split to separate using following code line and then get for example LeakRate [µBar/Min] and corresponding measurement that is 103 in zero index above.
df["Information"]str.split(";", expand=True)[1].str.split(":", expand=True)[1]
Unfortunately the data files that are produced are not always same, so positions are not always same. Therefore, I would like to locate specific string with special chars such as LeakRate [µBar/Min]
and then get the corresponding numbers so as to be able to plot them for further analysis.
Has anyone know a easy way doing it? I am new in python, so I appreciate any help.
Thanks,
Eala