EME 210
Data Analytics for Energy Systems

Why Python?

PrintPrint

Why Python

Python wordmark

Python is a high-level, object-oriented coding language. Python is widely used, not only in the energy industry, but also in financial institutions, government agencies, and academia. If you search for examples of Python code, the Internet is rife with them. There are Python tutorials on YouTube and online courses devoted to Python all over the internet. However, its widespread use isn't the only reason Python was selected for this course. There are other programming languages that are just as widely used, including C++, R, and Matlab, all of which can also be used for data analytics. So, what sets Python apart? There are three reasons why Python was selected for this course. It's highly functional, easy to use, and open source. 

Highly Functional

Python is highly functional. You can get a lot done with Python. It's very flexible. It covers all programming basics. Python is open source, meaning that anybody in the world can contribute Python code. People can write what are called packages for Python libraries and contribute sets of code to accomplish things. This course will expose you to some widely used libraries for data science. The Pandas library works with data frames based on tables of data. Further on in the course, we will work with some statistics-oriented packages. But these sorts of libraries and packages aren't just relegated to data science. If you're a PNG student, for example, there are packages devoted to reservoir simulation, which you can utilize in Python. Python spans disciplines. Most things can be accomplished in Python. So, it is highly flexible, highly adaptable, and there are many resources available.

Easy to Use

Python is relatively easy to use, compared to C++ or Fortran, and some other languages. In particular, it's a very readable language. The syntax that you see on the screen, in terms of function names, arguments to functions, and the things that you need to provide to make Python work just makes sense. There's an intuitive feeling to it all. For example, if you want to read in a CSV file or comma-separated file, the function to do that is “Read CSV.” You pretty much know what the function is going to do just by its name. That's a really nice thing to have. Furthermore, there's no compilation of the code that's needed. Say, for example, you need to write your code, then you need to compile it in binary, then execute it. There's this intermediate step, as we'll see with Google Colab. It just runs. It just runs on the screen, in real-time. We can easily cycle back and edit your code to get things looking how you want it to look.

Open Source

Python is open source. It's free. You don't have to pay anything for it. Penn State has MATLAB readily available for students to use, but you can't take that resource with you after you graduate, and purchasing your own MATLAB licenses is expensive. With Python being open source, you can take it with you anywhere you go. It will always be free to use. You can use Colab anywhere in the world, or you can even install Python on your own machine. Additionally, the open-source nature of Python means that there are a lot of freely accessible documentation, learning resources, and support communities online.  


 frequently asked questions FAQ