Suppose I have the dataframe pd.DataFrame({'a':nan, 'b':nan, 'c':{'a':1, 'b':2},{'a':4, 'b':7, 'c':nan}, {'a':nan, 'b':nan, 'c':{'a':6, 'b':7}}). I want to take the values from the keys in the dictionary in column c and parse them into keys a and b.
Expected output is:
a b c 0 1 2 {'a':1, 'b':2} 1 4 7 nan 2 6 7 {'a':6, 'b':7} I know how to do this to create new columns, but that is not the task I need for this, since a and b have relevant information needing updates from c. I have not been able to find anything relevant to this task.
Any suggestions for an efficient method would be most welcome.
** EDIT **
The real problem is that I have the following dataframe, which I reduced to the above (in several, no doubt, extraneous steps):
a b c 0 nan nan [{'a':1, 'b':2}, {'a':6, 'b':7}] 1 4 7 nan and I need to have output, in as few steps as possible, as per
a b c 0 1 2 {'a':1, 'b':2} 1 4 7 nan 2 6 7 {'a':6, 'b':7} Thanks!
.fillna