
Introduce scientific programming with Python, presenting a nine-chapter foundation, open resources, and a hands-on workflow across VSCode, Anaconda, and notebooks to guide learning.
Learn to write hello world in Python using print in Python 3, and differences from Python 2. Explore running Python via the command line, VS Code, and Anaconda.
Define variables as containers, demonstrate assignment and printing, compare assignment versus equality, and illustrate using descriptive names with integers and floats for principal, rate, years, and comments.
Learn to format text output in Python using print statements and f-strings, embedding variables in curly braces with format specifiers to control decimals, integers, and compact representations.
Learn how rounding errors and inexact arithmetic affect Python math, see why 1/49 and 1/51 differ, and apply tolerance when comparing floats; avoid reserved words and integer-division pitfalls.
Learn how Python lists store sequences of data using square brackets, access elements by index (0-based indexing), and use append, extend, and nested lists to manage heterogeneous data.
Explore default function arguments and keyword arguments in Python, learn to add docstrings, and apply a velocity-time example to override defaults for flexible calculations.
Learn to read user input with Python command line arguments using sys.argv. Discover passing arguments to a program from Unix, Windows, or PowerShell and running as a script.
Learn to handle flexible user input using exec and eval in Python. The lecture contrasts evaluating expressions with executing statements, handles multi-line strings, and builds an input-driven calculator.
Explore handling errors in Python using standard exceptions and try-except blocks, with hands-on demos of input validation, command-line arguments, and common errors like index, value, and syntax errors.
Explore numpy and array computing for scientific programming, including vector generalization, storage of xy points in two- or three-dimensional space, lists versus numpy arrays, and plotting curves with matplotlib.
Learn to plot curves with matplotlib in Python, build a basic chart, and configure titles, legends, and axis labels while plotting multiple curves.
Learn to turn static plots into animations using matplotlib and numpy, export frames for a movie, or use matplotlib's built-in animation to visualize a gaussian bell function.
Discover the similarities between dictionaries and lists in python, focusing on keys, values, membership testing, and deletion. Understand copy behavior—reference versus clone—and how to print keys and values efficiently.
Learn to read text data from a file into a dictionary, using the first column as the key and the second as the value, with cleaning and float conversion.
Explore string manipulation in Python by performing slicing, find and replace, and split and join operations, with practical code demonstrations.
Learn how string splitting and joining act as inverse operations, with code demonstrating split and join, and explore immutable strings and replacement techniques.
Explore how to protect class attributes in Python by marking them as protected with a leading underscore, illustrated through a bank account example and guarded access via methods.
Explore Python special methods, including __call__ and __str__, and see how constructors (__init__) create instances and enable callable objects and custom print outputs.
Learn how to test class functions by creating instances and verifying methods against known outputs. Use a linear function ax + b and a lambda input to validate derivatives.
This book "Scientific Programming with Python" teaches the Python programming language, which is one of the most popular languages for introductory programming courses. An advantage of Python is that it is a so-called high-level language, with simple and intuitive syntax that makes it easy to get started. However, although it works well as a beginner’s language, Python is also suitable for more advanced tasks, and it is currently one of the most widely used programming languages worldwide.
This course base on this nice book, putting all of the knowledge points together, and making the detail step-by-step live demo to show you the practical approach of learning Python programming language.
The source code (both native Python code and Jupyter notebooks format) are hosted in my GitHub repository (called "python", then you can find the folder "sci-prog" from the README file), you can pick up to start from any point or learn from start.
Python is one very popular and suitable language for learning to program, there's no specific pre-requisite for you to learn in this course, and during the journey, I'd hope you can also compare Python with other hands-on programming language (C, C++, Java, etc..) if you also have touch-based, with those benchmarking you may get deeper understanding of Python programming language's syntax, grammar as well as coding styles.
This course can be used on the foundation for you to explore more topics on Python, I also have some other courses teaching on Python with GUI, Python with Office, Use Python in Math, and also specific library Manim for creating pretty animation, there're big potential of using Python to deal with the situations that you may face and master this language will enable you to solve a problem in structural and computerized manner.
Enjoy your learning, and remember: Learning is a journey, not destination!