I have a data frame `df` like:

```
age=14  gender=male     loc=NY  key=0012328434    Unnamed: 4
age=45  gender=female   loc=CS  key=834734hh43    pre="axe"
age=23  gender=female   loc=CA  key=545df35fdf    NaN
..
..
age=65  gender=male     loc=LA  key=dfdf545dfg    pre="cold"

```

And I need this df to have a header and remove the redundant data, like `desired_df`:

```
age     gender          loc     key             pre
14      male            NY      0012328434      NaN
45      female          CS      834734hh43      axe
23      female          CA      545df35fdf      NaN
..
..
65      male            LA      dfdf545dfg      cold

```

what I tried to do:

```
df1 = df.str.split()
df_out = pd.DataFrame(df1.str[1::2].tolist(), columns=df1[0][0::2])

```

but this fails, clearly as I do not have a df name to begin with. Any help would be really appreciated.