ETSI Caminos, Department of Applied Mathematics and Computer Sciences University of Cantabria Avenida de los Castros s/n 39005 Santander, Spain http://www.meteo.unican.es
Máster Data Science/Ciencia de Datos - 2020/2021
Agenda ● NumPy internals ○ Bits, bytes and memory positions ○ ndarrays in memory ■ Copies and views ○ Exercises From previous class ● Python: Iterables, Iterators, Generators and Ranges ○ Iterable ○ Generator-iterator objects ○ Yield expressions ○ Range (memory efficient)
for x in iterable: return [func(x) for x in interable] yield func(x) ● Be aware of lazy evaluation and mutable objects! From previous class ● When to use high-order functions ○ Lambda functions ○ Map and filter ■ Numpy apply ■ Pandas apply ○ xarray reduce NumPy NumPy Open the notebook
● Multidimensional arrays in memory and disk
○ Ordering ○ Chunks ● Bits, bytes and types ○ Little endian vs big endian ● Views and copies NumPy II Ezequiel Cimadevilla Álvarez ezequiel.cimadevilla@unican.es
Santander Meteorology Group
ETSI Caminos, Department of Applied Mathematics and Computer Sciences University of Cantabria Avenida de los Castros s/n 39005 Santander, Spain http://www.meteo.unican.es