user288609
user288609

Reputation: 13015

keyerror message was given after runing dataframe.head().to_dict()

I have a dataframe season_statistics_T1, its related information is given as follows. Each operation looks normal except season_statistics_T1.head().to_dict(), which gives the key error message. I am not sure why.

enter image description here

enter image description here

enter image description here

enter image description here

Upvotes: 2

Views: 344

Answers (1)

wwnde
wwnde

Reputation: 26676

Lets try

df.head().to_json(orient="split")

Or

df.to_json(orient="records")

Upvotes: 1

Related Questions