Learn to rearrange array elements of NumPy array 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, applied statistics, neural
- [Narrator] The Rearranging Array Elements file…in your exercise file folder is prepopulated with an…import statement and three arrays.…Remember, go to the Cell menu and execute Run All.…The first function that we'll evaluate is fliplr…or flip left right.…Let's examine the content of my three by eight array…and let's apply num pi dot fliplr…to my three by eight array.…
What you can see is the order of the rows has been reversed.…The first row was previously…zero, one, two, three, four, five, six, seven.…Now going back to front,…it's zero, one, two, three, four, five, six, seven.…Let's examine the contents of my two by three by four array.…If we use the flip left right function…on my two by three by four array,…the results might be slightly counterintuitive.…What you'll see here is the arrays…are stacked top to bottom.…
In other words, the function says left to right,…but the displayed presentation is bottom to top.…This is consistent with the definition…where the flipping takes place over the last index.…Similar to fliplr is a flipud or flip up down.…
- 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.