Open rbu opened 1 year ago
@rbu is there a reason you're using X.plot.hist instead of X.hist?
To my understanding np.nan values should be allowed as they work when the 'by' parameter is not passed, but if anyone could elaborate whether or not they should be allowed when 'by' is passed I would appreciate that.
In the Code it looks intentional that nan values are not accepted, so I think an error message should be added in that case to let people know that nan values are not possible with the parameter by != None. (Unless the functionality to accept nan values should be added)
Pandas version checks
[X] I have checked that this issue has not already been reported.
[X] I have confirmed this bug exists on the latest version of pandas.
[ ] I have confirmed this bug exists on the main branch of pandas.
Reproducible Example
Issue Description
Generating a histogram plot that contains NaN values raises a
ValueError
when using numpy 1.24.Searching for the error message, #50342 popped up. I have confirmed that this is a different bug and that neither pandas 1.5.3 nor 2.0.0 which contain that commit fix this.
Expected Behavior
I would expect to see a plot, or at least an error message explaining what is wrong with the data.
With numpy 1.23.X and earlier, I was getting a plot and this warning originating from pandas code:
Installed Versions