mean, nanmean and warning: Mean of empty slice
I really can’t see any good reason not to just suppress the warning. The safest way would be to use the warnings.catch_warnings context manager to suppress the warning only where you anticipate it occurring – that way you won’t miss any additional RuntimeWarnings that might be unexpectedly raised in some other part of your code: … Read more