d = {"name: "name1", "key1" : ["A", "B"], "key2": ["C"]}
and I want to create DataFrame with 1 row and columns name, key1 and key2 with values respectively name1,["A", "B"] and ["C"]
>Solution :
One way is to create it with index orientation then transpose it.
import pandas as pd
d = {"name": "name1", "key1" : ["A", "B"], "key2": ["C"]}
df = pd.DataFrame.from_dict(d, orient='index').transpose()
print(df)
Output:
name key1 key2
0 name1 [A, B] [C]