Code Monkey home page Code Monkey logo

pythonnumericaldemos's Introduction

PythonNumericalDemos: Educational Data Science Demonstrations Repository (1.0.0)

Professor Michael Pyrcz, The University of Texas at Austin

A collection of Python demos for spatial data analytics, geostatistics and machine learning methods.

Please cite as:

Pyrcz, Michael J. (2021). PythonNumericalDemos: Educational Data Science Demonstrations Repository (1.0.0). Zenodo. https://doi.org/10.5281/zenodo.5564991

I use these demonstrations for:

  1. in-lecture walkthroughs
  2. hands-on experiential learning with specific tasks suggested in the accompanying lecture notes
  3. example workflows to support my students

Other resources that you might be interested in include:

While I have more than 20 years experience coding in FORTRAN, C++ and VBA, I just started with Python a couple of years ago. I love it. I code less and get more done! I recommend Python to any engineers or scientists. Here's some reasons to learn to code:

  1. Transparency – no compiler accepts hand waiving! Coding forces your logic to be uncovered for any other scientist or engineer to review.

  2. Reproducibility – run it, get an answer, hand it over, run it, get the same answer. This is a main principle of the scientific method.

  3. Quantification – programs need numbers. Feed the program and discover new ways to look at the world.

  4. Open-source – leverage a world of brilliance. Check out packages, snippets and be amazed with what great minds have freely shared.

  5. Break Down Barriers – don’t throw it over the fence. Sit at the table with the developers and share more of your subject matter expertise for a better product.

  6. Deployment – share it with others and multiply the impact. Performance metrics or altruism, your good work benefits many others.

  7. Efficiency – minimize the boring parts of the job. Build a suite of scripts for automation of common tasks and spend more time doing science and engineering!

  8. Always Time to Do it Again! – how many times did you only do it once? It probably takes 2-4 times as long to script and automate a workflow. Usually worth it.

  9. Be Like Us – it will change you. Users feel limited, programmers truly harness the power of their applications and hardware.

Alright, that is enough of my ranting. Especially, since I haven't even introduced myself yet!

The Author:

Michael Pyrcz, Professor, The University of Texas at Austin

Novel Data Analytics, Geostatistics and Machine Learning Subsurface Solutions

With over 17 years of experience in subsurface consulting, research and development, Michael has returned to academia driven by his passion for teaching and enthusiasm for enhancing engineers' and geoscientists' impact in subsurface resource development.

For more about Michael check out these links:

Want to Work Together?

I hope this content is helpful to those that want to learn more about subsurface modeling, data analytics and machine learning. Students and working professionals are welcome to participate.

  • Want to invite me to visit your company for training, mentoring, project review, workflow design and / or consulting? I'd be happy to drop by and work with you!

  • Interested in partnering, supporting my graduate student research or my Subsurface Data Analytics and Machine Learning consortium (co-PIs including Profs. Foster, Torres-Verdin and van Oort)? My research combines data analytics, stochastic modeling and machine learning theory with practice to develop novel methods and workflows to add value. We are solving challenging subsurface problems!

  • I can be reached at [email protected].

I'm always happy to discuss,

Michael

Michael Pyrcz, Ph.D., P.Eng. Associate Professor The Hildebrand Department of Petroleum and Geosystems Engineering, Bureau of Economic Geology, The Jackson School of Geosciences, The University of Texas at Austin

More Resources Available at: Twitter | GitHub | Website | GoogleScholar | Book | YouTube | LinkedIn

pythonnumericaldemos's People

Contributors

geostatsguy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pythonnumericaldemos's Issues

Library

@GeostatsGuy Do you have a list of libraries that can be called to install all the required libraries you are using in the notebooks?
It will be very helpful to have the list. Thanks a lot.

Error while running Variogram Calculation for Subsurface Data Analytics in Python in the examples module

Calculate Sample Data Isotropic Variograms

tmin = -9999.; tmax = 9999.;
lag_dist = 100.0; lag_tol = 100.0; nlag = 7; bandh = 9999.9; azi = 0; atol = 90.0; isill = 1

lag, por_sand_gamma, por_sand_npair = geostats.gamv(df_sand,"X","Y","NPor",tmin,tmax,lag_dist,lag_tol,nlag,azi,atol,bandh,isill)
lag, por_shale_gamma, por_shale_npair = geostats.gamv(df_shale,"X","Y","NPor",tmin,tmax,lag_dist,lag_tol,nlag,azi,atol,bandh,isill)
lag, por_gamma, por_npair = geostats.gamv(df,"X","Y","NPor",tmin,tmax,lag_dist,lag_tol,nlag,azi,atol,bandh,isill)

lag, perm_sand_gamma, perm_sand_npair = geostats.gamv(df_sand,"X","Y","NPerm",tmin,tmax,lag_dist,lag_tol,nlag,azi,atol,bandh,isill)
lag, perm_shale_gamma, perm_shale_npair = geostats.gamv(df_shale,"X","Y","NPerm",tmin,tmax,lag_dist,lag_tol,nlag,azi,atol,bandh,isill)
lag, perm_gamma, perm_npair = geostats.gamv(df,"X","Y","NPerm",tmin,tmax,lag_dist,lag_tol,nlag,azi,atol,bandh,isill)

plt.subplot(121)
plt.plot(lag,por_gamma,'x',color = 'black',label = 'All')
plt.plot(lag,por_sand_gamma,'x',color = 'orange',label = 'Sand')
plt.plot(lag,por_shale_gamma,'x',color = 'brown',label = 'Shale')
plt.plot([0,2000],[1.0,1.0],color = 'black')
plt.xlabel(r'Lag Distance $\bf(h)$, (m)')
plt.ylabel(r'$\gamma \bf(h)$')
plt.title('Isotropic NSCORE Porosity Variogram')
plt.xlim([0,700])
plt.ylim([0,1.8])
plt.legend(loc='upper left')
plt.grid(True)

plt.subplot(122)
plt.plot(lag,perm_gamma,'x',color = 'black',label = 'All')
plt.plot(lag,perm_sand_gamma,'x',color = 'orange',label = 'Sand')
plt.plot(lag,perm_shale_gamma,'x',color = 'brown',label = 'Shale')
plt.plot([0,2000],[1.0,1.0],color = 'black')
plt.xlabel(r'Lag Distance $\bf(h)$, (m)')
plt.ylabel(r'$\gamma \bf(h)$')
plt.title('Isotropic NSCORE Permeaiblity Variogram')
plt.xlim([0,700])
plt.ylim([0,1.8])
plt.legend(loc='upper left')
plt.grid(True)

plt.subplots_adjust(left=0.0, bottom=0.0, right=2.0, top=1.2, wspace=0.2, hspace=0.3)
plt.show()

Trying to run this block of code and getting the following error


TypeError Traceback (most recent call last)
TypeError: expected dtype object, got 'numpy.dtype[float64]'

The above exception was the direct cause of the following exception:

SystemError Traceback (most recent call last)
in
3 lag_dist = 100.0; lag_tol = 100.0; nlag = 7; bandh = 9999.9; azi = 0; atol = 90.0; isill = 1
4
----> 5 lag, por_sand_gamma, por_sand_npair = geostats.gamv(df_sand,"X","Y","NPor",tmin,tmax,lag_dist,lag_tol,nlag,azi,atol,bandh,isill)
6 lag, por_shale_gamma, por_shale_npair = geostats.gamv(df_shale,"X","Y","NPor",tmin,tmax,lag_dist,lag_tol,nlag,azi,atol,bandh,isill)
7 lag, por_gamma, por_npair = geostats.gamv(df,"X","Y","NPor",tmin,tmax,lag_dist,lag_tol,nlag,azi,atol,bandh,isill)

~/anaconda3/lib/python3.8/site-packages/geostatspy/geostats.py in gamv(df, xcol, ycol, vcol, tmin, tmax, xlag, xltol, nlag, azm, atol, bandwh, isill)
1795
1796 # Loop over combinatorial of data pairs to calculate the variogram
-> 1797 dis, vario, npp = variogram_loop(
1798 x, y, vr, xlag, xltol, nlag, azm, atol, bandwh
1799 )

SystemError: CPUDispatcher(<function variogram_loop at 0x7fc1b09b6160>) returned a result with an error set

Repeated text for OLS and MLE

In Interactive_Model_Fitting.ipynb , you seem to have repeated the same text before eqn (1) and eqn (2).
I suspect eqn (2) should be something else.

Unable to install library pymc3

Downloaded Anaconda 3 and did pip install geostatspy package. Opened ipykernel in Jupyter notebook and pasted code to install pymc3 in the box. The kernel then runs for a long time (30+ minutes), and then shows Unsatisfiable Error and No Module Found: pymc3. Appreciate your quick help as I need to use pymc3 for a Bayesian Linear Regression School Project.

Inverse CDF

I think the inverse CDF graphics have switched axes, Values should be on the Y axis and probability on the x Axis.
On the Gaussian example I used:
plt.subplot(1,3,3)
plt.plot(p_values, x_values,'r-', lw=5, alpha=0.3, label='uniform pdf')

And the graph looked more like the inverse CDF graphs I searched on the Internet.
Please let me know if I am wrong.

And thanks for the wonderful studying material.

can't find Ripley's K function

hi Michael, I was trying to follow the Ripley's K example here: Ripley_K_demo.ipynb but I cannot find, import or run a ripley_K function on the GeostatsPy package. Has it been removed?

thanks very much
Carolyn

Issue with Interactive_ParametricDistributions.ipynb

Hi, @GeostatsGuy ....I have detected an issue running this notebook (by the way, it's an excellent educational resource, as the rest of notebooks in your repositories). Matplotlib graphs do not clear correctly in events with clear_output(). If you run the notebook you can see that every time you click the widget controls, the frame is not cleared and the plot is replicated. In my case, I have fixed this issue replacing plt.plot() by plt.show()......

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.