Skip to Content
Scientific Computing with Python - Second Edition
book

Scientific Computing with Python - Second Edition

by Claus Führer, Claus Fuhrer, Jan Erik Solem, Olivier Verdier
July 2021
Intermediate to advanced
392 pages
9h 40m
English
Packt Publishing
Content preview from Scientific Computing with Python - Second Edition
Advanced Array Concepts

In this chapter, we will explain some more advanced aspects of arrays. First, we will cover the notion of an array view – a concept that a NumPy programmer absolutely must be aware of to avoid hard-to-debug programming errors. Then, Boolean arrays will be introduced along with the ways to compare arrays. Furthermore, we will briefly describe indexing and vectorization, explaining special topics such as broadcasting and sparse matrices.

In this chapter, we will be covering the following topics:

  • Array views and copies
  • Comparing arrays
  • Array indexing
  • Performance and vectorization
  • Broadcasting 
  • Sparse matrices

5.1 Array views and copies

In order to control precisely how memory is used, NumPy offers the concept of a view of ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Scientific Computing with Python 3

Scientific Computing with Python 3

Claus Führer, Claus Fuhrer, Jan Erik Solem, Olivier Verdier
Mastering Numerical Computing with NumPy

Mastering Numerical Computing with NumPy

Umit Mert Cakmak, Tiago Antao, Mert Cuhadaroglu

Publisher Resources

ISBN: 9781838822323Supplemental Content