Created
July 2, 2021 08:05
-
-
Save yohanesnuwara/3f4b791d2f1ee358c6302c682a07c441 to your computer and use it in GitHub Desktop.
Calculate probability of neutron porosity from drilling torque
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import statviz | |
# Choose lithology | |
lith = 'marl' # sandstone, claystone, marl | |
# Two variables to plot against | |
x, y = 'TORQUE', 'BPHI' | |
# Bounds of each variable to evaluate probabilities | |
xbound, ybound = (20e3, 22.5e3), (20, 30) | |
df = merge_fac_df[merge_fac_df.LITH==lith] | |
# Plot KDE | |
statviz.kde2d(df, x, y, evaluate_proba=True, xbound=xbound, ybound=ybound) | |
# Calculate probabilities from KDE | |
Px, Py, Pxny, Pxy_cond = statviz.compute_proba_2d(df, x, y, xbound, ybound) | |
print(Px, Py, Pxny, Pxy_cond) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment