NumPy is one of my favorite packages. It’s one of the most powerful numeric packages available on any programming languages..Tied with Python, it makes for a quick script fiddling with a lot of numbers..Did you know that you could develop your machine learning algorithms in NumPy? That’s how I initially learned to implement my AI algorithms..Btw, does anyone have the answer to guru’s question in the last line of code? 🤔
.
👨💻#NumPy
.
👨💻#NumPy
Let’s continue our NumPy discussion, shall we? 👍 .
I found NumPy’s matmul and multiply confusing when I was starting out, so why not compare them in a post?
.
matmul is the equivalent of the dot product between two matrices, where the last dimension of the first matrix has to be equal to the first dimension of the second matrix. Easy, right? 💪
.
On the other hand, multiply is the convenient operation of taking two same size matrices and multiplying them element wise. This will come in handy when we talk about building deep neural nets 🔜
.
Don’t forget to swipe to see the code examples ‼️‼️
.
Question: NumPy has another operation called “dot” 🤯 what do you think that does (hint is in this post)
.
👨💻#NumPy
I found NumPy’s matmul and multiply confusing when I was starting out, so why not compare them in a post?
.
matmul is the equivalent of the dot product between two matrices, where the last dimension of the first matrix has to be equal to the first dimension of the second matrix. Easy, right? 💪
.
On the other hand, multiply is the convenient operation of taking two same size matrices and multiplying them element wise. This will come in handy when we talk about building deep neural nets 🔜
.
Don’t forget to swipe to see the code examples ‼️‼️
.
Question: NumPy has another operation called “dot” 🤯 what do you think that does (hint is in this post)
.
👨💻#NumPy
Hello data scientists 👋 and welcome to the post of the day 🙏 .It’s time we talk about NumPy slicing. NumPy slicing is a very common technique to manipulate large data 📊.It can be used with any number of dimensions of data with the same syntax 🤔.Here I was able to extract my favorite fruits from a large array of food items. Neat, right? 💡.Keep in mind array[:, 1:3] will take all the rows (:) and columns 1 and 2 of the dataset.
.
👨💻#NumPy
.
👨💻#NumPy
Hiii data scientists 👋👋.Hope your week is off to a great start.I know I couldn’t start mine properly without talking about some NumPy 🤦🏻♂️.3 new functions and a useful concept for today, shall we? 👍.zeros(), ones() and diag() are three super useful functions I use all the time using NumPy. They give us the three basic matrixes: matrix of zeros, ones, and a diagonal matrix with specific values, respectively 👌.Doing arithmetic with NumPy matrices is super easy, unless what you’re doing is a matrix operation, all other operations occur at element level such a scalar multiplier and scalar addition 🙌.Liked today’s lesson? Let me know what you would like to learn next
.
👨💻#NumPy
.
👨💻#NumPy
Hi data science enthusiasts 👋 and welcome to part 5 of intro to NumPy.Today, we are gonna talk about broadcasting in NumPy 🔢.Broadcasting is a powerful, useful yet tricky feature in NumPy. If you know it by heart and use it intentionally, you can simplify a lot of code 👌.However if it’s used by mistake it can create bugs and a lot of headaches 👎.That’s because in NumPy, you can easily do operations between matrices even if the matrices don’t have the same shape.NumPy “broadcasts” the smaller matrix (if valid for the operation) and repeats the operation per element, row, column, etc 🤘.In today’s code snippet, a matrix can be added to a scalar element-wise through this feature, a column vector can get added to every column, and a row vector can get added to every row.Again, really powerful stuff 💪💪.Hope you’re enjoying the journey we are on so far as much as I am.
.
👨💻#NumPy
.
👨💻#NumPy