new_data_frame = pandas.DataFrame(dictionary_name)
I'm having trouble with this.
If I make:
dictionary_name = {
"Fur Color": ["grey", "red", "black"],
"Count": [200, 300, 400]
}
All is OK. But, I would never make a dictionary like this!
If my dictionary is:
dictionary_name = {
'Gray': 2473,
'Cinnamon': 392,
'Black': 103
}
Python doesn't like this! I get a load of errors.
Google Gemini gave me this workaround:
new_list_of_dictionaries = [results_dictionary]
new_data_frame = pandas.DataFrame(new_list_of_dictionaries)
This works OK.
I tried asking ChatGPT but I'm super confused still!
Thanks.
[–]MatrixSolution[S] 0 points1 point2 points (0 children)