"JavaScript Loops, Arrays and Objects" was retired on December 18, 2020. You are now viewing the recommended replacement.
Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll
Well done!
You have completed Introduction to NumPy!
You have completed Introduction to NumPy!
You can create an array of booleans and then use that to index into your array. Let's use this to filter our values.
Learn more
My Notes for Indexing
## Creation
* You can create a random but bound grouping of values using the `np.random` package.
* `RandomState` lets you seed your randomness in a way that is repeatable.
* You can append a row in a couple of ways
* You can use the `np.append` method. Make sure the new row is the same shape.
* You can create/reassign a new array by including the existing array as part of the iterable in creation.
## Indexing
* You can use an indexing shortcut by separating dimensions with a comma.
* You can index using a `list` or `np.array`. Values will be pulled out at that specific index. This is known as fancy indexing.
* Resulting array shape matches the index array layout. Be careful to distinguish between the tuple shortcut and fancy indexing.
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign upRelated Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
You need to sign up for Treehouse in order to download course files.
Sign upYou need to sign up for Treehouse in order to set up Workspace
Sign up