log, random number generators and more!
ndarrayfor this type of computing. Imagine when you need to conduct calculations on more than 200k rows with 10k columns over and over again.
pandas, having an understanding of it will help us use tools in pandas with less pain.
numpyand their attributes and methods. And then we will perform basic scientific computations in
numpythen the "as np" says call it
np(our alias) this just simplifies our life without having to always type
numpy, we just type
np. IF you're lost on this, go back to our chapter on importing packages.
ndarrayis the primary building block of numpy. It enables us to perform mathematical computations efficiently using similar syntax to the equivalent operations for scalar elements as we learned in python fundamental notebook 1.
ndarrayto explore this. One is its
.shape. This will be reported as the number of rows and columns if its a two dimensional array. What should we expect?
rangeobject when using it with for loops. Here we present the
numpyarray version of it.
numpy, transpose an 1-d or 2-d array is super easy and fast via
numpywhen performing array arithmetic, which can greatly speed up and simplify your code.
numpyarray is like we have done for lists. Let's first define a two-dimensional array and then review what we have learned.
numpywith samples from a “standard normal” distribution in specified shape.
arraywith one demension is essentially just a vector of data while a
arraywith two dimension can be thought a table of data with rows and columns. We will not cover dimension more than 2 in this course.
-, among 1-d or 2-d arrays and the implicit usage of broadcasting in them.
np.sum. This one require the correctly setting the
axisparameters in the