NumPy is the de facto standard for scientific computing in Python. It extends Python with a flexible multidimensional array that allows fast mathematical calculations.
NumPy works as a framework that allows coding complex operations using a concise syntax. The multidimensional array (
numpy.ndarray) is internally based on C arrays: in this way, the developer can easily interface NumPy with existing C and FORTRAN code. NumPy constitutes a bridge between Python and the legacy code written using those languages.
In this chapter, we will learn how to create and manipulate NumPy arrays. We will also explore the NumPy broadcasting feature to rewrite complex mathematical expressions in an efficient and succinct ...