Search icon CANCEL
Subscription
0
Cart icon
Cart
Close icon
You have no products in your basket yet
Save more on your purchases!
Savings automatically calculated. No voucher code required
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
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

Product type Book
Published in Jun 2018
Publisher Packt
ISBN-13 9781789530797
Pages 168 pages
Edition 1st Edition
Languages
Author (1):
Curtis Miller Curtis Miller
Profile icon Curtis Miller
Toc

NumPy arrays


Let's now talk about NumPy arrays, which are called ndarray. These are not the arrays you may encounter in C or C++. A better analog is matrices in MATLAB or R; that is, they behave like a mathematical object resembling a mathematical vector, matrix, or tensor. While they can store non-mathematical information such as strings, they exist mainly to manage and facilitate operations with data that is numeric in nature. ndarray are assigned a particular data type or dtype upon creation, and all current and future data in the array must be of that dtype. They also have more than one-dimension, referred to as axes.

A one-dimensional ndarray is a line of data; this would be a vector. A two-dimensional ndarray would be a square of data, effectively a matrix. A three-dimensional ndarray would be key book data, like a tensor. Any number of dimensions is permitted, but most ndarray are one or two-dimensional.

dtype are similar to types in the basic Python language, but NumPy dtype resemble...

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 $15.99/month. Cancel anytime