Python Pandas: ValueError: DataFrame Constructor Not Properly Called!

463    Asked by Anil Mer in Python , Asked on Nov 17, 2022

I am trying to create a Python Pandas Dataframe using this code:

But I am getting this error:

ValueError: DataFrame constructor not properly called!

Answered by Amit Sinha

Just ran into the same error - dataframe constructor not properly called. My code worked fine on my computer which was like this:

test_dict = {'x': '123', 'y': '456', 'z': '456'}
However, it did not work on another platform. It gave me the same error as mentioned in the original question. I tried below code by simply adding the list() around the dictionary items, and it worked smoothly after:

Your Answer


Parent Categories