I have a dataframe with just one column with content like:
view: meta_record_extract
dimension: e_filter
type: string
hidden: yes
sql: "SELECT * FROM files"
dimension: category
type: string
...
What I tried to produce would be a dataframe with columns and the data like this:
____________________________________________________________________
view | dimension |label | type | hidden | sql |
meta_record_extract| e_filter | NaN | string| yes |"SELECT * FROM files"
NaN | category | NaN | string ...
Given that splitting the string data like
df.header[0].split(': ')[0]
was giving me label with [0] or value with [1] I tried this:
df.pivot_table(df, columns = df.header.str.split(': ')[0], values = df.header.str.split(': ')[1])
but it did not work giving the error.
Can anyone help me to achieve the result I need?