Skip to content

Fix parameter distribution heatmap #58

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Aug 29, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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