Arrray-Oriented Programming with NumPy (Deitel Ch 7)

Objectives

In this chapter, you’ll:

  • Learn what arrays are and how they differ from lists.
  • Use the numpy module’s highperformance ndarrays.
  • Compare list and ndarray performance with the IPython %timeit magic.
  • Use ndarrays to store and retrieve data efficiently.
  • Create and initialize ndarrays.

  • Refer to individual ndarray elements.

  • Iterate through ndarrays.
  • Create and manipulate multidimensional ndarrays.
  • Perform common ndarray manipulations.
  • Create and manipulate pandas one-dimensional Series and two-dimensional DataFrames.

NumPy (Numerical Python) Library

  • First appeared in 2006 and is the preferred Python array implementation.
  • High-performance, richly functional n-dimensional array type called ndarray.
  • Written in C and up to 100 times faster than lists.
  • Critical in big-data processing, AI applications and much more.
  • According to libraries.io, over 450 Python libraries depend on NumPy.
  • Many popular data science libraries such as Pandas, SciPy (Scientific Python) and Keras (for deep learning) are built on or depend on NumPy.
In [ ]: