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

Arithmetic and linear algebra with arrays

Now that we have seen how to create and access information with NumPy arrays, let's cover some of the numerical operations you can do with arrays. In this section, we will be discussing arithmetic using NumPy arrays; we also discuss using NumPy arrays for linear algebra.

Arithmetic with two equal-shaped arrays

Arithmetic with NumPy arrays is always done component-wise. This means that, if we have two matrices that have equal shapes, an operation such as addition is done by matching corresponding components in the two matrices and adding them. This is true for any arithmetic operation, be it addition, subtraction, multiplication, division, powers, or even logical operators.

Let...

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 €18.99/month. Cancel anytime