Is there a reason you can’t set the column names on the next line?
my_dict = {'key1' : [1,2,3], 'key2' : [4,5,6], 'key3' :[7,8,9]}
df = pd.DataFrame.from_dict(my_dict, orient="index")
df.columns = ['one', 'two', 'three']
Should work.
Is there a reason you can’t set the column names on the next line?
my_dict = {'key1' : [1,2,3], 'key2' : [4,5,6], 'key3' :[7,8,9]}
df = pd.DataFrame.from_dict(my_dict, orient="index")
df.columns = ['one', 'two', 'three']
Should work.