Source Code:
(back to article)
import pandas as pd # Create a sample dictionary my_dict = {'a': 1, 'b': 2, 'c': 3} # Convert the dictionary into a dataframe df = pd.DataFrame.from_dict(my_dict, orient='index', columns=['value']) # Print the dataframe print(df)
Result:
Report an issue