Issue
I have a massive DataFrame, and I'm getting the error:
TypeError: ("Empty 'DataFrame': no numeric data to plot", 'occurred at index 159220')
I've already dropped nulls, and checked dtypes for the DataFrame so I have no guess as to why it's failing on that row.
How do I print out just that row (at index 159220) of the DataFrame?
Solution
When you call loc
with a scalar value, you get a pd.Series
. That series will then have one dtype
. If you want to see the row as it is in the dataframe, you'll want to pass an array like indexer to loc
.
Wrap your index value with an additional pair of square brackets
print(df.loc[[159220]])
Answered By - piRSquared
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.