diff --git a/src/fmu/ensemble/virtualensemble.py b/src/fmu/ensemble/virtualensemble.py index 3a57f6d0..c121483d 100644 --- a/src/fmu/ensemble/virtualensemble.py +++ b/src/fmu/ensemble/virtualensemble.py @@ -1015,10 +1015,13 @@ def get_smry_meta(self, column_keys=None): matches = matches.union( [name for name in available_smrynames if fnmatch.fnmatch(name, key)] ) + # The .replace() in the chain below is to convert NaN's to None, to + # mimic the dataframes before they are exported to disk. return ( self.get_df("__smry_metadata") .set_index("SMRYCOLUMN") .loc[matches, :] + .replace({pd.np.nan: None}) .to_dict(orient="index") )