你也可以试试这个
d = {"key1":1,"key2":42,"key3":"foo"} df = pd.DataFrame.from_dict(d, orient='index').T print(df) key1 key2 key3 0 1 42 foo