I am looking for a one-liner solution to write a dictionary into a pandas DataFrame row.
The other way round works quite intuively with an expression like df.loc[2, :].to_dict(dct).
Illustration
I am looking for a shot expression to replace the for key in dct.keys()-loop in the following code:
>>> import numpy as np
>>> import pandas as pd
>>> df = pd.DataFrame(np.arange(12).reshape(3,4), columns=list('abcd'))
>>> dct = {'a': 77, 'c':-1}
>>>
>>> df
a b c d
0 0 1 2 3
1 4 5 6 7
2 8 9 10 11
>>> dct
{'a': 77, 'c': -1}
>>>
>>> for key in dct.keys():
... df.loc[1, key] = dct[key]
...
>>>
>>> df
a b c d
0 0 1 2 3
1 77 5 -1 7
2 8 9 10 11