Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Mastering Python Data Visualization

You're reading from   Mastering Python Data Visualization Generate effective results in a variety of visually appealing charts using the plotting packages in Python

Arrow left icon
Product type Paperback
Published in Oct 2015
Publisher
ISBN-13 9781783988327
Length 372 pages
Edition 1st Edition
Languages
Arrow right icon
Toc

Table of Contents (11) Chapters Close

Preface 1. A Conceptual Framework for Data Visualization 2. Data Analysis and Visualization FREE CHAPTER 3. Getting Started with the Python IDE 4. Numerical Computing and Interactive Plotting 5. Financial and Statistical Models 6. Statistical and Machine Learning 7. Bioinformatics, Genetics, and Network Models 8. Advanced Visualization A. Go Forth and Explore Visualization Index

Slicing

Arrays can be sliced just like lists and tuples. Array slicing is identical to list slicing, except that the syntax is simpler. Arrays are sliced using the [ : , :, ... :] syntax, where the number of dimensions of the arrays determine the size of the slice, except that these dimensions for which slices are omitted, all elements are selected. For example, if b is a three-dimensional array, b[0:2] is the same as b[0:2,:,:]. There are shorthand notations for slicing. Some common ones are:

  • : and: are the same as 0:n:1, where n is the length of the array
  • m: and m:n: are the same as m:n:1, where n is the length of the array
  • :n: is the same as 0:n:1
  • ::d: is the same as 0:n:d, where n is the length of the array

All these slicing methods have been referenced with the usage of arrays. This can also be applicable to lists. Slicing of one-dimensional arrays is identical to slicing a simple list (as one-dimensional arrays can be seen equivalent to a list), and the returned type of all the slicing...

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
Banner background image