Learn how to use slicing techniques for NumPy variables in this video tutorial by Charles Kelly and Lynda.com (a LinkedIn company). These are explained in the context of computer science and data science to technologists and students in preparation for ma
- [Narrator] In this video, we'll learn…how to reference elements within an array…and to assign values to elements within an array.…NumPy indexes, or if you prefer, indices, are zero-based.…This means that the first element in a row…is referenced using zero.…If we create an array my_vector,…we can use the np_array function,…take the values from a Python list,…and create the array.…If you'd like to see the value of the elements…within my_vector, you can simply type the name.…
Here I'm using the Tab key.…Jupyter supplies the remaining portions…that I didn't type.…Use Shift + Enter and we can see the values…created within the array.…We can select elements within an array…by typing its name, using square brackets,…and selecting the element that we wish to display.…In this case, the zeroth element is -17.…We can assign values using a similar notation.…In this case, we're saying my_vector,…the zeroth element, takes on the value of -102.…
Again, to display a vector,…we simply type its name.…Indices can be negative numbers.…
- Using Jupyter Notebook
- Creating NumPy arrays from Python structures
- Slicing arrays
- Using Boolean masking and broadcasting techniques
- Plotting in Jupyter notebooks
- Joining and splitting arrays
- Rearranging array elements
- Creating universal functions
- Finding patterns
- Building magic squares and magic cubes with NumPy and Python
Skill Level Intermediate
2. Create NumPy Arrays
3. Index, Slice, and Iterate
4. Plots: Matplotlib and Pyplot
5. Manipulate Arrays
6. Short Examples
7. Extended Examples
- 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.