Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Hands-On Data Analysis with NumPy and pandas

You're reading from   Hands-On Data Analysis with NumPy and pandas Implement Python packages from data manipulation to processing

Arrow left icon
Product type Paperback
Published in Jun 2018
Publisher Packt
ISBN-13 9781789530797
Length 168 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Curtis Miller Curtis Miller
Author Profile Icon Curtis Miller
Curtis Miller
Arrow right icon
View More author details
Toc

Linear algebra

Be aware that NumPy is built to support linear algebra. A 1D NumPy array may correspond to a linear algebra vector; a 2D array to a matrix; and 3D, 4D, or all ndarray to tensors. So, when appropriate, NumPy supports linear algebra operations, such as matrix products, transposition, matrix inversion, and so on, for arrays. Most NumPy linear algebra functionality is supported in the linalg module. The following is a list of commonly used NumPy linear algebra functions:

Some of these are ndarray methods, others are in the linalg module you need to import. So we've actually been demonstrating transpose up to this point in earlier examples. Notice that we were using transpose here to swap around rows and columns.

This is transposition in arr4:

I said arr4 was arr3 and we switched around the axes. So axis 0 would still be axis 0, but axis 1 would be axis 2...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime