I've been learning Python recently, and was working with Pandas when this error came up:
import pandas
students = {"Adi": 32, "Ron" : 64, "Jonny": 34}
student_dataframe = pandas.DataFrame(students) # <--- error
print(student_dataframe) # this will only print table
The error:
student_dataframe = pandas.DataFrame(students)
^^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: If using all scalar values, you must pass an index' when creating dataframe
When I click on error location it takes me to source code of Pandas (I think?) and shows an error. It was working just fine a few days back... how do I fix it? Is the source code the problem or have I missed something?
pandas.DataFrame(students.items()){}button to mark blocks of code, or indent with four spaces for the same effect. The contents of a screenshot can’t be searched, run as code, or easily copied and edited to create a solution.Adi,RonandJonny, with a single value in each. I doubt that's what you really wanted