Reputation: 13
Below is the code I used:
temp_df = pd.DataFrame(temp, columns=["Top","Column number","Row number"])
temp_df = temp_df.sort_values(by=["Top"],axis=1)
The second line is throwing the following error:
I literally have no clue as to why it is throwing an error. Please help me out.
Upvotes: 0
Views: 1454
Reputation: 26201
It's the axis=1
in your .sort_values()
that's causing problems: there is no such index 'Top'
(but there is a column 'Top'
).
In other words, change your second line to:
temp_df = temp_df.sort_values(by='Top')
Upvotes: 3