Learn to distinguish references, views, and copies within NumPy arrays in this video tutorial by Charles Kelly. These are explained in the context of computer science and data science to technologists and students in preparation for machine learning, appl
- View Offline
- Exercise Files
- [Narrator] The views and copies file…in your exercise folder,…contains an import statement from NumPy.…Sometimes people are familiar…with other programming languages,…but who are new to Python and or NumPy,…make coding errors based upon how data is stored in memory.…A copy takes data from one location in memory,…and replicates it in a different location in memory.…Views provide two or more differently named references…to the same location in memory.…The Spanish language has an expression of hospitality,…mi casa es su casa, in English this means,…my house is your house.…
With this play on words we'll begin by creating an array…with the named reference, mi casa.…Mi casa is equal to a NumPy array.…Using a Python list, we'll create a second reference,…su casa and set it equal to mi casa.…The question that we want to answer,…is whether or not these two references…refer to the same locations in memory,…and if not whether or not they refer to the same values.…
The questions that we're gonna be asking are,…are these the same or are they different?…
- 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?
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.