Questions tagged [nanmean]

2 questions
1
vote
1 answer

RuntimeWarning: Mean of empty slice return np.nanmean(a, axis, out=out, keepdims=keepdims), but not using nanmean anywhere, and a np.polyfit error

I keep getting this RuntimeWarning, and I can't figure out where it's coming from, since I don't use np.nanmean anywhere in my program. I do use np.mean, though. Does anyone know if there's some other numpy function (e.g., np.mean) that calls…
bt3
  • 156
  • 1
  • 10
0
votes
0 answers

How to get the mean of two numpy arrays of np.nan without throwing a RuntimeWarning

When I take the nanmean of an array that has an all-empty slice I get the warning "RuntimeWarning: Mean of empty slice". I think this is fairly obvious - but what is the easiest way to resolve this warning but still get the same behavior without…
negfrequency
  • 1,801
  • 3
  • 18
  • 30