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!
Preview
Let's take a look at a detailed example that uses the new array programming paradigm. We'll have NumPy do some linear algebra for us!
Code
orders = np.array([
[2, 0, 0, 0],
[4, 1, 2, 2],
[0, 1, 0, 1],
[6, 0, 1, 2]
])
totals = np.array([3, 20.50, 10, 14.25])
Learn More
- Build a Learning Mindset
- Wikipedia - Array Programming
- Khan Academy - Linear Algebra <== Wonderful courses
- NumPy also has a
matrixdatatype. This is for historical reasons. Learn more about array vs. matrix
My Notes from Manipulation
## Array Manipulation
* The documentation on [Array Manipulation](https://docs.scipy.org/doc/numpy/reference/routines.array-manipulation.html) is a good one to keep bookmarked.
* `ndarray.reshape` creates a view with a new shape
* You can use `-1` as a value to infer the missing dimension
* `ndarray.ravel` returns a single dimensional view of the array.
* `ndarray.flatten` can be used to make a single dimensional copy.
* `np.lookfor` is great for searching docstrings from within a notebook.
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 can create, inspect, and modify them.
0:00
You can manipulate them into new shapes,
and
0:01
you can filter out
the values you don't want.
0:03
And now, I'd like to take some to
show off some common use cases for
0:05
these arrays that we've
been getting to know.
0:08
But before we dive in here,
0:11
I'd like to take a second to discuss
a phenomenon known as imposter syndrome.
0:12
Imposter syndrome happens when
you doubt your skills, and
0:19
you feel like you really aren't a pro.
0:21
You feel like a fraud.
0:23
You feel like everyone
else knows more than you.
0:24
It's an unfortunate and
quite common feeling, and
0:27
I want you to know that you
aren't alone in experiencing it.
0:29
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