Learn how to use slicing to select and change subset of an array. See how you can select columns and assign values. You can talk about boundaries of slices and the fact that Python uses 0 based indexing.
- [Instructor] In Python, we can use the slice operator…to select subsets of data.…Here's an example.…Nums will be the list of one, two, three…four, and five.…And now we'll use a slice,…Nums from two to four.…Slices are half-open,…which means we get the first index,…and Python indices start with zero,…but not the last one.…We can do the same for NumPy arrays.…Let's create a vector,…V equals np.arange…from one to six.…
And then we'll use the slice from two to four.…Slicing is useful for getting a subset of larger dataset…for training, testing, and other purposes,…and NumPy takes slicing to a whole new level.…Let's take a look.…Array is np.arange…of 12.…And let's reshape it to three and four.…And let's take a look.…So we have our width three rows and four columns.…And now if we do array at location zero,…we will get the first row.…
If we'd like a specific element,…we can do array,…second row, second column,…or we can do array second row, second column.…What happens when we want a column?…We can use a column to select everything.…
- 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.