Learn how broadcasting allows use to combine arrays of different shapes and even combine arrays and scalars (simple numbers). You can see how easy it is to scale all values of an array.
[Instructor] We touched broadcasting area,…but now let's take a closer look.…Let's create a small vector.…Array equal NumPy arange of three.…And then we can do array plus four.…Through adding a scaler to a vector,…a NumPy does what makes sense for us.…It adds this scaler to every element of the array.…We can do the same with other math operations,…we can do array divided by seven,…and we can do array to the power of two.…
Broadcasting works for other dimensions as well.…Let's create a matrix of three by three,…so matrix equals np.arange of nine,…and then reshape with three on three.…And then, let's also create a vector of three.…And now, we're going to do the matrix plus the vec.…NumPy is matching the shapes and extending vector…to be the same size of the matrix.…Vector itself does not change.…We can even do one vector, which is np.arange of three,…and then another vector, which is np.arange of three,…but we'll reshape it to be three rows and one column.…
Let's take a look at vector two,…and if you look at the shape,…
- Working with Jupyter notebooks
- Using code cells
- Extensions to the Python language
- Markdown cells
- Editing notebooks
- NumPy basics
- Broadcasting, array operations, and ufuncs
- Folium and Geo
- Machine learning with scikit-learn
- Plotting with matplotlib and bokeh
- Branching into Numba, Cython, deep learning, and NLP
Skill Level Intermediate
1. Scientific Python Overview
2. The Jupyter Notebook
3. NumPy Basics
Manage environments5m 11s
6. Folium and Geo
7. NY Taxi Data
10. Other Packages
11. Development Process
Next steps1m 33s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.