A Beginner’s Roadmap to Python for Scientific Computing
The world of scientific computing can seem daunting, filled with complex formulas and specialized software. But what if you could leverage the power of a user-friendly programming language to tackle these challenges? Enter Python, a versatile tool that’s perfect for beginners looking to dive into scientific computing.
This blog post is your roadmap to getting started with Python for scientific tasks. We’ll break down the journey into manageable steps, equipping you with the foundational knowledge and resources to succeed.
Level 0: Python Setup
Setting up Python involves choosing the right environment and tools tailored to your needs. Here’s a short introduction on PyCharm, Jupyter Notebook and Google Colab — three popular environments for scientific computing.
Jupyter Notebook is an open-source web application that enables the creation and sharing of documents with live code, equations, visualizations, and narrative text. It supports multiple programming languages, Python being one of them. Google Colab (short for Colaboratory) is a cloud-based Jupyter notebook environment provided by Google, offering free access to computing resources, including GPUs and TPUs. Whereas, PyCharm, developed by JetBrains, is a powerful Integrated Development Environment (IDE) specifically designed for Python development. Along with paid professional edition, it comes with free open-source community edition. You can find
For beginners, I will strongly suggest starting with Google Colab. You can start with this short 3-minute YouTube Tutorial on how to use Google Colab. Once you are comfortable with Google Colab, you may go for PyCharm installation in Windows .
Level 1: Basic Python
Once you are comfortable with the environment, the next step is to grasp the basics of Python. The main topics to cover while learning all the basics of Python language are discussed below:
- Data Types: Python has a hefty variety of data types which has some different variables. It assigns a memory bytes set to every single type and for every data type-particular set of operations are permitted.
- Typecasting: You need to convert one data type into another in Python employing the typecasting method. Various functions can be employed to transform strings into integers, numeric values, or float, into string types.
- Operators: These are the main symbols that assist the compiler to run some particular logical or mathematical operations.
- Data Structure: Data structure is a concept that assists in writing dynamic programs in any program. Certainly, Python is a high-level programming language with the basics of data structure as compared to other programming languages.
- Conditional statement: There reaches a point where some statement is to form in a way if some conditions are true. The conditional statement assists to run such sort of job. You will find several conditional statements such as nested if, if-elif, if, if…else, etc.
- Loops: These are the conditional statement that is formed as long as the conditional statement come backs true. You will see 3 different types of loops in a Python programming language which are while nested loop, loop, and for a loop.
- Functions: These functions can be described as a whole group of statements in a program that runs a particular task. It is the reusable code employed to run a solely related task. Employing function lessens any error in code as it is possible to test a certain function at a time and also assists in deducting the size of code as not writing the same code again in a program. Moreover, you can make a function and call that function to perform some sort of task.
To learn these basics one can, follow the below resources -
- YouTube Lectures- First 15 lectures of the playlist Python and Google Colab.
- Tutorial- All blogs in `Learn the Basics` section https://www.learnpython.org/
- Book- Chapter 1 to 8 of Python Crash Course.
- This single lecture from FreeCodeCamp is also a beautiful resource to start — https://youtu.be/eWRfhZUzrAc?si=TePQPmFOT8EnyGAK
- https://pythongeeks.org/learn-python-tutorial/ have some good blogs which I personally love.
Level 2: Scientific Computing Python
Python’s rich libraries come into picture for scientific computing. To start with scientific computing, I recommend the articles written by SciPy team -1. Getting started with Python for science — Scipy lecture notes (scipy-lectures.org). This should be one’s first choice to learn Python for Scientific computing.
Along with this, I also suggest going through the well written resources provided by Alto University — Python for Scientific Computing — Python for Scientific Computing documentation (aaltoscicomp.github.io). This contains basics of Python which you have already learned and some advanced concepts such as Library ecosystem, parallel programming, Web APIs which you can skip for now.
Once the above is completed (Articles by SciPy team or Alto University), I strongly recommend going through this playlist Scientific Programming Using Python. This tutorial contains some beautiful videos on how to use Python for plotting.
Some of the most popular and important Library with their official documentation and tutorial are listed below which I suggest revisiting in time-to-time manner. Programming languages evolve with time, old features get deprecated, new features gets added. Hence revisiting official documentation and tutorial is highly recommended.
- NumPy, the most used library for large numerical computation — NumPy — Learn
- Pandas, most used library to handle large data in CSV, JSON format- Getting started tutorials — pandas 2.2.2 documentation (pydata.org)
- Matplotlib. This is most used library for plotting graphs, images in Python- Tutorials — Matplotlib 3.9.0 documentation
- SciPy- Specialized for Scientific computing in Pytho.
Level 3: Intermediate Python
After going through the basics of Python, now we will head further to learn the intermediate-level topics for it. Some of those are mentioned below:
- Classes: These are the focal point of Object-Oriented Programming (OOP) and assist well to define the object in a view of its description however it divides the object itself.
- Lambda: The function which is not well described employing the basic format of function mentioning def keyword is called lambda function.
- Different types of file handling in Python.
For these I will suggest following —
- YouTube Lecture —Python OOP Tutorials — Working with Classes .
- Tutorial — Learn Python — Free Interactive Python Tutorial contains some beautiful blogs on this.
- Book — Chapter 9 and 10 of Python Crash Course.
I will expand this section to include few more concepts such as Parallel Programming, High Performance Computing or Web Scrapping for collecting data and their related resources. Beginners should avoid this section and focus on only above sections.