Learn practical skills, build real-world projects, and advance your career

How to use Python for Linear Algebra

Numpy Array Operations

side note:

I was trying to follow with requirements of assignments. It turns out that I wrote way too much about linear algebra. The process is tedious and could be unnecessary. But I found out the knowledge started to be deep in my mind, which is one of the by-product I did not expect.

In this notebook, you will see the basic concepts of linear algebra with NumPy. For those who don't know NumPy, it's a library comprising of modules and functions written in Python. NumPy library is built upon C language because Python is interpreted language.

Pandas, a popular library for data analysis, is also built on NumPy. It's an amazing library where you possibly can explore analysis for a long time. But the aim of this notebook is to focus on linear algebra for machine learning.

Regaring linear algebra, we have to understand what vector, matries , and their arithmetic operations are. To be fair, we'd be confused for moments when it comes to matrix multiplication. Simply put, our brain has the limitation to space visualization . To encourage some readers, it's absolutely okay that our brain can't fully understand space such as 4D,5D, etc. Mathematics is very powerful. Everything has nowadays mathematical theories to support.

It is like riding a bike.The notebook is tutorials about basic linear algebra, but the only way to learn it is by doing it. You would discover it after the practice. Half of the questions we may have are not just simple matters of knowing how it is done and then we are able to do it, we have to experiment and build a basis, so wee can move from there and use knowledge to work for you.

I'd suggest that you open a new notebook and type them along, you will have surprises to understand them as times goes by!

Or you can see the table of contents if you're on Googlee colab to pick up what you want.

How to use Python for Linear Algebra

Linear algebra is beautiful. I discovered the screct during my master's. People from various coutries speak English in different accents. Surprisingly it's the same in mathematics. I had no idea about what my lecturers were talking about because it was a different notation system in the western system. Of course, I was struggling with it. Having googled what to do, reddit told me that I should absolutely read Gilbert Strang's book, Introduction to Linear Algebra Gilbert asked " You can describe 3D, 4D,.....many D with linear algebra." I was hooked.

Let's begin by importing Numpy and listing out the functions covered in this notebook.

import numpy as np

Function 1