Target
I have a pandas dataframe as shown below and would like to split it where there is a blank-space, separating the "command" and the float value.
Dataframe - df
e.g:
0
...
432 cl_bob_lower_amt "0"
433 cl_bobamt_lat "0"
434 cl_bobamt_vert "0"
435 cl_bobcycle "2"
436 cl_viewmodel_shift_left_amt "0"
437 cl_viewmodel_shift_right_amt "0"
...
My Attempt
I have attempted to use the solution described here
import pandas as pd
file_ = open("E:\\Location\\Tree\\123456\\730\\local\\cfg\\myconfig.cfg", 'r')
content = file_.read()
paths = content.split("\n")
df = pd.DataFrame(paths)
df = pd.DataFrame(df.row.str.split(' ',1).tolist(),columns = ['command','value'])
print df
However, I seem to be receiving the following error:
AttributeError: 'DataFrame' object has no attribute 'row'
Unfortunately I'm unable to identify why this occurs.
Expected Outcome:
command value
...
432 cl_bob_lower_amt "0"
433 cl_bobamt_lat "0"
434 cl_bobamt_vert "0"
435 cl_bobcycle "2"
436 cl_viewmodel_shift_left_amt "0"
437 cl_viewmodel_shift_right_amt "0"
...
Ultimately I would like the user to be able to search for the command and change the value.