Subject ▸ python

Live applications of statistics in geoscience with Binder

Introduction This is a step-by-step guide on how to turn your Jupyter notebooks into live applications by adding a remote virtual machine running in The virtual machine is automatically built in the background after you supply a list of the packages that your notebooks or scripts require. Motivation Although, my main objective was not writing, or develop, on how to convert Jupyter notebooks to running applications, but rather convert the Jupyter JSON format to Rmarkdown, and then be able to run them from remote sessions of RStudio and RShiny, it was difficult to ignore the value that live Jupyter notebooks would bring to Python users.

Read More…

A Python plotnine book built with Rmarkdown

Motivation Found this interesting article by Jeroen Janssens on applying the Grammar of Graphics introduced to data science by #rstats ggplot2. The amazing thing is that the article has been totally computed with Python as the coding engine, while the text is in Rmarkdown. The plots have been generated by the Python package plotnine, practically duplicating what R ggplot2 does! I liked the article so much that I decided to make it a “minimal book” with R bookdown, maintaining the Python computations.

Read More…

R and Python commingled: how to get the best of both worlds. Season 1, Episode 1

I confess. I have been in a long term relationship with … Python. Sometimes feels like 10+ years- other times like 15+ years, if I count my sporadic adventures with the language. Few years ago, I finally dared to explore other universes, and took the #rstats R route. I don’t regret it at all. It has been years of full productivity, challenges in learning the language, discovering its strong publishing tools (blogdown, bookdown, pkgdown, and the king of all: Rmarkdown), its science-oriented ecosystem, and, of course, making discoveries from data.

Read More…

Python, 3D seismic using segyio by Matteo Nicoli

Found this interesting article in LinkedIn:

WORKING WITH 3D SEISMIC DATA IN PYTHON USING SEGYIO AND NUMPY (MOSTLY) by Matteo Nicoli. It comes with code, Python notebook and repository.

Keywords: segyio, seismic, python, notebook


Calculate economic risk with regression using Python by Matteo Niccoli

Another reproducible example of regression using Python to calculate economic risk. By Matteo Niccoli (2017).



Python and PVT by Mark Burgoyne

PVT coded in Python!

Keywords: PVT, Python, phase behavior, EOS


Python libraries for Production Engineering

Somebody asked me earlier if I know of libraries for Production Engineering written in Python. Meaning, open source code for production engineering, production optimization, artificial lift, or gas lift, specifically. Unfortunately, to my knowledge, there are not open source Python libraries for Production Engineering. Most of the applications or software for optimization and nodal analysis are proprietary requiring fees and and licenses. From that side, the curious petroleum engineer would have to code everything, practically, from scratch.

Read More…

For what things R programming language is better than Python?

I used and wrote Python applications for more than 10 years. Then, I started to use R for my data science projects in Petroleum Engineering. I know Python quite well, being one its major weaknesses multiple versions of Python floating around and packages with no “adult” supervision. Anyway, after 2 years of R experience (far too short if you compare it with that of the R experts), this is my take on what makes R better than Python:

Read More…

Is R as versatile as Python?

The short answer is no. R is not a versatile as Python. R is a comprehensive statistical, mathematical and scientific tool. Its learning curve could be daunting and intimidating but the effort pays if you deal with data every day. Python and R are not in the same league either. While Python is a generic developing and prototyping tool, R focus is narrower, focusing on providing sciences and engineering with well thought data analytics functions and packages.

Read More…

Data Science for Petroleum Production Engineering

In the last century, the production engineer built the well models one by one and analyzed the results also one by one. With the ubiquity of the personal computer, desktops and laptops, an unimaginable computational power has been put in our hands. But we need the right tools! The spreadsheet was invented in the 80’s and was a great invention. The beauty of it is that you can produce results right away.

Read More…