Skip to Content
Mastering Numerical Computing with NumPy
book

Mastering Numerical Computing with NumPy

by Umit Mert Cakmak, Tiago Antao, Mert Cuhadaroglu
June 2018
Intermediate to advanced
248 pages
5h 27m
English
Packt Publishing
Content preview from Mastering Numerical Computing with NumPy

How does NumPy manage memory?

Once you initialize a NumPy array, its metadata and data are stored at allocated memory locations in Random Access Memory (RAM).

import numpy as nparray_x = np.array([100.12, 120.23, 130.91])

First, Python is a dynamically typed languages; there is no need for the explicit declaration of variables types such as int or double. Variable types are inferred and you'd expect that in this case the data type of array_x is np.float64:

print(array_x.dtype)float64

The advantage of using the numpy library rather than Python is that numpy supports many different numerical data types such as bool_, int_, intc, intp, int8, int16, int32, int64, uint8, uint16, uint32, uint64, float_, float16, float32, float64, complex_, complex64 ...

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

Numerical Computing with Python

Numerical Computing with Python

Pratap Dangeti, Allen Yu, Claire Chung, Aldrin Yim
Scientific Computing with Python - Second Edition

Scientific Computing with Python - Second Edition

Claus Führer, Claus Fuhrer, Jan Erik Solem, Olivier Verdier
SciPy and NumPy

SciPy and NumPy

Eli Bressert

Publisher Resources

ISBN: 9781788993357Supplemental Content