Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Mastering Python Data Visualization

You're reading from  Mastering Python Data Visualization

Product type Book
Published in Oct 2015
Publisher
ISBN-13 9781783988327
Pages 372 pages
Edition 1st Edition
Languages

Table of Contents (16) Chapters

Mastering Python Data Visualization
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
A Conceptual Framework for Data Visualization Data Analysis and Visualization Getting Started with the Python IDE Numerical Computing and Interactive Plotting Financial and Statistical Models Statistical and Machine Learning Bioinformatics, Genetics, and Network Models Advanced Visualization Go Forth and Explore Visualization Index

Scalar selection


Scalar selection is the simplest method to select elements from an array and is implemented using [rowindex] for one-dimensional arrays, [rowindex, columnindex] for two-dimensional arrays, and so on. The following is a simple code that shows an array element reference:

import numpy as np
x = np.array([[2.0,4,5,6], [1,3,5,9]])

x[1,2]
5.0

A pure scalar selection always returns a single element and not an array. The data type of the selected element matches the data type of the array used in the selection. Scalar selection can also be used to assign a value to an array element, as shown in the following code:

x[1,2] = 8

x
array([[2, 4, 5, 6],[1, 3, 8, 9]])
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}