on-internet
← Community

Omitting missing or Nan columns in Pandas plot

Stack Overflow ·

I am plotting a pandas data frame with 4 columns. Either one or two of the four columns may have Nan or the entire column may be missing. In my code below, I get the error TypeError: unhashable type: 'Series' In the below code, commenting out the first two plots gives plots 3 and 4. Including either of plots 1 and 2 leads to the above error indicated for the line if x_col in df.columns and y_col in df.columns: I do not understand the example given in lib/python3.12/site-packages/pandas/core/indexes/base.py", line 5358 My problem is the definition of the function I adapted from an SO post. In t

Comments

Sign in or sign up to comment and upvote.

No comments yet.