Skip to content

Commit

Permalink
Convert nan to None for get_smry_meta (#125)
Browse files Browse the repository at this point in the history
Needed for dataframes that has been on disk
  • Loading branch information
berland authored Mar 30, 2020
1 parent edcb534 commit 5aa7943
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/fmu/ensemble/virtualensemble.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
)

Expand Down

0 comments on commit 5aa7943

Please sign in to comment.