From 281879ecce060f4ee89d91507d994e62236ab5a5 Mon Sep 17 00:00:00 2001 From: thouska Date: Mon, 14 Jan 2019 15:14:52 +0100 Subject: [PATCH] Enable automatic nan filtering for RMSE #79 --- spotpy/objectivefunctions.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spotpy/objectivefunctions.py b/spotpy/objectivefunctions.py index 2c485a89..fbcc32ad 100644 --- a/spotpy/objectivefunctions.py +++ b/spotpy/objectivefunctions.py @@ -225,7 +225,7 @@ def mse(evaluation, simulation): if len(evaluation) == len(simulation): obs, sim = np.array(evaluation), np.array(simulation) - mse = np.mean((obs - sim)**2) + mse = np.nanmean((obs - sim)**2) return mse else: logging.warning("evaluation and simulation lists does not have the same length.")