Skip to content

Commit

Permalink
Fix parameter distribution heatmap (#58)
Browse files Browse the repository at this point in the history
  • Loading branch information
WestfalNamur authored and anders-kiaer committed Aug 29, 2019
1 parent dc4807f commit dda698b
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions webviz_subsurface/containers/_parameter_distribution.py
Original file line number Diff line number Diff line change
Expand Up @@ -321,13 +321,20 @@ def render_matrix(ensemble_path):

data = get_parameters(ensemble_path).apply(pd.to_numeric, errors='coerce')\
.dropna(how='all', axis='columns')
values = list(data.corr().values)

# .dopna() required to remove undefined entries in correlation matrix after
# it is calcualted. Correlations between constants yield nan values since
# they are undefined.
# Passing tuple or list to drop on multiple axes is deprecated since
# version 0.23.0. Therefor split in 2x .dropnan()
corr_data = data.corr().dropna(axis='index', how='all') \
.dropna(axis='columns', how='all')

data = {
'type': 'heatmap',
'x': data.columns,
'y': data.columns,
'z': values,
'x': corr_data.columns,
'y': corr_data.columns,
'z': list(corr_data.values),
'zmin': -1,
'zmax': 1
}
Expand Down

0 comments on commit dda698b

Please sign in to comment.