Courses Forge News Mímir AI Contact
Sign In Subscribe
Sign In Subscribe
Home Courses Forge News Mímir AI Contact Subscribe
This site uses cookies to get a better user experience, by using it you agree with our privacy policy.

Chapter 1 - Introduction to Python

  • 1.01 Pythonic Introduction (9 min.) Sample Lesson
  • 1.02 Intro to Python Coding (4 min.)
  • 1.03 Course Coverage (2 min.)

Chapter 2 - Basic Syntax And Commands

  • 2.01 Print (11 min.)
  • 2.02 Indentation (10 min.)
  • 2.03 Comments (5 min.)
  • 2.04 Variables (5 min.)
  • 2.05 Data Types (9 min.)
  • 2.06a String Slicing (14 min.)
  • 2.06b Strings Continued (12 min.)
  • 2.07 Numeric Values and Type Casting (9 min.)
  • 2.08 Operators (15 min.)
  • 2.09 Falsy Values (3 min.)
  • 2.10 f-string (10 min.)
  • 2.11 Lists (18 min.)
  • 2.12 Dictionary (16 min.)
  • 2.13 If Statements (20 min.)
  • 2.14 Loops (21 min.)

Chapter 3 - Advanced Functions, Classes and Objects

  • 3.01 Functions (33 min.)
  • 3.02 Lambda and Anonymous Functions (3 min.)
  • 3.03 Classes and Objects (25 min.)
  • 3.04 Files (16 min.)
  • 3.05 Exceptions (11 min.)

Chapter 4 - Modules, Packages and Extra Functions

  • 4.01 Modules and Packages (11 min.)
  • 4.02 Extra Functions (9 min.)
  • 4.03 Comprehension (7 min.)
Become Pythonic in Oil & Gas / Chapter 1 - Introduction to Python

Lesson 1.01 Pythonic Introduction

Back

We can't find the internet

Attempting to reconnect

Something went wrong!

Hang in there while we get back on track

Access All SAGA Wisdom Training content Subscribe
Already a member? Sign in
Access All SAGA Wisdom Training content Subscribe
Already a member? Sign in

Transcript

01. Become Pythonic in Oil & Gas Lesson 1.01: Pythonic Introduction02. Why Python?03. When to Use Python

01. Become Pythonic in Oil & Gas Lesson 1.01: Pythonic Introduction

OK, this is the start of the course, Become Pythonic in Oil & Gas Industry. In this course I will walk you through the building blocks of Python code and how to write and run Python code. And to answer specific questions that you may have in your projects, especially those which are dealing with the data. So this course has been designed specifically to work with the data more smoothly using Python.
Back to Top

02. Why Python?

So let's start the course and the first question that you may have in your mind is what is Python? I would say that Python is the fastest growing general-purpose programming language in the world. And it has gained a huge popularity these days. And you will see where that popularity is coming from.
Python solves complex problems in less time with fewer number of lines of code. And then Python also is an interpreted language, which means that as soon as you write your code, Python can execute and give you the results which makes Python very popular for the purpose of typing or quick and fast programing tasks.
To officially summarize why we should use Python I would like to mention 5 points. The first one is that Python is a high-level programing language. It will hide many details of how a program interacts with the computer to give you the results and you don't need to know much of those details and those stuff is being handled in the background by Python itself.
The second point is that Python is the cross-platform language, which means that you write the code one time and you can run it on Windows or Linux system or Mac and they give you exactly the same results. So that is a fantastic feature of Python.
The third point to mention is that Python has a very simple syntax. Actually, it shares many similarities with the plain English language. If somebody reviewed your code, he or she can easily understand what you are trying to achieve with that code, because it is very similar to just the way that we talk and write.
The next point would be Python has huge community support. If you get stuck on your code and have a question or problem, you can go online, search for that specific question or problem and I am sure that you would find tons of solutions that people have provided around the world.
And the last point is that Python has a very large eco-system, which means that if you have a very specific need or you are looking for a very special task to be accomplished, probably somebody has already developed a package that you can find and deploy it in your code and marriage it, customize it or whatever you like and use it in your code.
Back to Top

03. When to Use Python

So when to use Python? That is a question that I will say in four regions you can use Python, the first one is automation. If you have a repetitive task here, for example, working with the number of files, extracting data from then, putting them into Excel, working on those Excel, creating different Excel sheets. Or different tabs in one Excel sheet and on each tab, you are creating multiple columns. And then you want to repeat this task, probably with one Python script, you can accomplish the same tasks very easily and it will give you consistent results and it will reduce the amount of mistakes that you may make during working on each of those individual parts.
Another region is the data analysis. If you are working with the data, which I know is the case for most of the engineers in general, then Python is very powerful in that region too. You can work with the data like data cleaning, extracting features, then sorting the data and then plotting data different variables with respect to each other, you can easily do that in Python.
Another region which is emerging and evolving a lot is the artificial intelligence and machine learning. In the recent years, fascinating packages have been developed for Python, to work with artificial intelligence and machine learning projects. You will be amazed how easy it is to develop a machine learning algorithm in Python. In a few lines, you can have your projects ready and it will generate results easily. It is just amazing.
And the last one is the Web application. You can write your code and share your code with the world through the Web applications. And Python has a few packages, actually easy to use, like Flask or Django which gives you the ability to write Web applications.
OK. I think that's it for why and when for a Python. But before we start to dove into this course, I would like you to keep 3 points in mind. First of all, we are using Python 3 in this course. Python is coming in two versions Python 2 and Python 3, but we are using existing Python 3.7 or 3.6 or above and not Python 2. So if you go online, say for a solution, make sure that it is suitable for Python 3 not Python 2. So this is the first point.
The second point is that new line in Python means a new command. So in most other languages, you use a semicolon to indicate the end of a line or end of a command. But in Python, as soon as you go to the next line or a new line, it will be your new command line.
So the last one, which is very, very important and sometimes confusing especially for the new programmer or for people who are coming from a different programing language background. Avoid a space at the beginning of a new line, has a special meaning in Python. Python interprets that those white spaces at the beginning of a new line differently. And it uses those white spaces to define the scope of the code blocks. Don't worry if you don't understand this at this point, we will cover that in detail. You will see details of that during this course. OK. I think that's it for this lesson. See you in the next lesson.
Back to Top