Chapter 2. NumPy Arrays

After installing NumPy and other key Python-programming libraries and getting some code to work, it's time to pass over NumPy arrays. This chapter acquaints you with the fundamentals of NumPy and arrays. At the end of this chapter, you will have a basic understanding of NumPy arrays and their related functions.

The topics we will address in this chapter are as follows:

  • Data types
  • Array types
  • Type conversions
  • Creating arrays
  • Indexing
  • Fancy indexing
  • Slicing
  • Manipulating shapes

The NumPy array object

NumPy has a multidimensional array object called ndarray. It consists of two parts, which are as follows:

  • The actual data
  • Some metadata describing the data

The bulk of array procedures leaves the raw information unaffected; the sole facet that ...

Get Python Data Analysis now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.