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
Universal functions are vectorized functions that can work on all values in an array at once. This is part of the magic of how things work so fast in NumPy. Let's explore the common ones.
Learn More
- Automatic Vectorization (just immerse yourself, you don't need to understand it all)
- Write your own Ufunc
My Notes for New Way of Thinking
## Linear Algebra
* There is a module for linear algebra, [linalg](https://docs.scipy.org/doc/numpy/reference/routines.linalg.html)
* You can solve for a system of equations using the [solve function](https://docs.scipy.org/doc/numpy/reference/generated/numpy.linalg.solve.html#numpy.linalg.solve)
* You can create a square 2 dimensional matrix and a constant row vector and solve for each variable column
* You can double check the answer using the inner product or [dot](https://docs.scipy.org/doc/numpy/reference/generated/numpy.dot.html#numpy.dot).
* You can use the `@` to produce the dot product of two arrays.
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
It's not only faster, but we usually
ended up writing fewer lines of code.
0:00
Out of the box, there are quite a few
NumPy functions that are available for
0:02
you to use that are already vectorized.
0:05
These are referred to as
universal functions, or ufuncs.
0:07
When there's one of these
universal functions available for
0:11
what you're trying to accomplish,
you want to ensure that make use of it.
0:14
Before you start writing a loop,
look first to the ufuncs.
0:17
Let's take a look at the more popular
examples of these universal functions and
0:21
then I'll show you where to learn more.
0:26
Here are my notes from the linear
algebra exercise that we just did.
0:28
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