Under Python3, I have a dict with the following format:
my_dict = {'col1': 1.0, 'col2':2.0, 'col3': 3.0}
And I want to convert it to a pandas DataFrame using dict keys as columns:
col1 col2 col3
0 1.0 2.0 3.0
However, when I try the following command I have a ValueError:
df = pd.DataFrame(my_dict)
ValueError: If using all scalar values, you must pass an index