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
Hello Data Science & NumPy enthusiasts ππ.Of course itβs time for yet another episode on NumPy π.Stacking arrays horizontally and vertically is something I do almost everyday.When you train large networks, your data becomes very large arrays of features, and very often, itβs needed to stack them to be able to feed them to the next layer of the network.So itβs supeeeer helpful to know how to do that in NumPy and voila itβs not so bad with np.vstack and np.hstack, you can stack up your arrays as long as the sizes match in the direction youβre stacking π.Happy stacking ππ
.
π¨βπ»#NumPy
.
π¨βπ»#NumPy
βΌοΈ To ensure every new post is visible to you, please turn on post notification at the top right of the post βΌοΈ.Welcome to part 7 of our journey through NumPy π.When it comes to data manipulation, being able to filter data points of various ranges is a must π.NumPy makes it really easy to filter data points and reset their values π.I use this technique daily in my job to get the data in the form I need before feeding it to my machine learning model π.How are you planning to use NumPy in your projects βοΈβ
.
π¨βπ»#NumPy
.
π¨βπ»#NumPy
Welcome back to another NumPy lesson! π.Basketball players make a great excuse to learn about arg functions in NumPy π.argmax() returns the index of the element with the maximum value.argmin() returns the index of the element with the minimum value.argsort() returns the indices of the array in ascending order π.Basically what adding arg to the name of the function does is to make return the *index* of the element and not the element itself.This is handy for this example because we then use the index to retrieve the name of the player from the other array π€―π.
.
π¨βπ»#NumPy
.
π¨βπ»#NumPy
π£ Turn on post notifications to be always in the know
.
NumPy part 9: np.where()
.
np.where() returns the indices where the condition is met (not the elements themselves) π
.
.
.
π¨βπ»#NumPy
.
NumPy part 9: np.where()
.
np.where() returns the indices where the condition is met (not the elements themselves) π
.
.
.
π¨βπ»#NumPy
Part 10 π of Intro to NumPy, what a journey guys, thanks for sticking around for these posts!! On to part 100 shall we??
.
Follow u0040bigdataguru for tutorials and instructional posts on AI, machine learning and deep learning!
.
.
π¨βπ»#NumPy
.
Follow u0040bigdataguru for tutorials and instructional posts on AI, machine learning and deep learning!
.
.
π¨βπ»#NumPy
.
np.tile() is one of the most beautiful yet super useful functions there is in NumPy and Python! Happy weekend!! ππ
.
Typo alert: 4th slide should say np.array([[6], [7]]) for the picture to match!
.
π¨βπ»#NumPy
np.tile() is one of the most beautiful yet super useful functions there is in NumPy and Python! Happy weekend!! ππ
.
Typo alert: 4th slide should say np.array([[6], [7]]) for the picture to match!
.
π¨βπ»#NumPy
np.cumsum() is a useful function when it comes to doing big data cumulative sums. See it, learn it, and use it πͺ
.
.
.
π¨βπ»#NumPy
.
.
.
π¨βπ»#NumPy
This post is inspired by a great question on the last post! So keep asking great questions and motivate future posts πͺ
.
.
π¨βπ»#NumPy
.
.
π¨βπ»#NumPy
Hi Data Science enthusiasts π
.
Today, we are gonna talk about broadcasting in NumPy π’
.
Broadcasting is a powerful, useful yet tricky feature in NumPy. If you know it well 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 they 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 scalar broadcasts into the same size of a matrix to be subtracted. Similarly, a row and column vector broadcasts into the right shape before getting subtracted!
.
Wanna know how? Check out the post!
.π¨βπ»#NumPy
.
Today, we are gonna talk about broadcasting in NumPy π’
.
Broadcasting is a powerful, useful yet tricky feature in NumPy. If you know it well 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 they 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 scalar broadcasts into the same size of a matrix to be subtracted. Similarly, a row and column vector broadcasts into the right shape before getting subtracted!
.
Wanna know how? Check out the post!
.π¨βπ»#NumPy
Partitioning is an important technique when you have a large amount of data and like to partition it based on a pivot value. NumPy can do this very efficiently and it leads to some cool applications.
.
Wanna know more? Check out the slides!
.
.
π¨βπ»#NumPy
.
Wanna know more? Check out the slides!
.
.
π¨βπ»#NumPy
Being fluent in NumPy goes a long way in becoming a data scientist π Today we are taking an important step in that direction! π
.
Wanna know more? Check out the slides!
.
π¨βπ»#NumPy
.
Wanna know more? Check out the slides!
.
π¨βπ»#NumPy
Hi Data Science enthusiasts π
.
Today, we are gonna talk about broadcasting in NumPy π’
.
Broadcasting is a powerful, useful yet tricky feature in NumPy. If you know it well 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 they 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 scalar broadcasts into the same size of a matrix to be subtracted. Similarly, a row and column vector broadcasts into the right shape before getting subtracted!
.
Wanna know how? Check out the post!
.π¨βπ»#NumPy
.
Today, we are gonna talk about broadcasting in NumPy π’
.
Broadcasting is a powerful, useful yet tricky feature in NumPy. If you know it well 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 they 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 scalar broadcasts into the same size of a matrix to be subtracted. Similarly, a row and column vector broadcasts into the right shape before getting subtracted!
.
Wanna know how? Check out the post!
.π¨βπ»#NumPy