Lecture 1 - NdArrays Intro Flashcards
What is an ndarray?
This is a multidimensional numerical array
What is an image ?
A matrix of values, representing brightness points
What is a sound?
A vector of values, representing pressure
What is a video ?
A 3D tensor of values, representing brightness points
How are 3D graphics usually represented?
An ndarray of vertices (multiple rows of x,y,z points)
Are ndarrays efficient?
Yes , very , they’re also very compact.
What is vectorisation?
The practice of writing code which acts on arrays of values simultaneously is called. This is the case with operations on ndarrays using numpy.
What is vectorisation a case of ?
It is a special case of parallel computing, where we restrict
ourselves to numerical operations on fixed size arrays
What is SIMD (Single Instruction Multiple Data)
- this is what vectorisation is
- supported by modern CPUs
What are GPUs?
GPUs are array processors. They have big groups of very simple processors, which are able to deal
very well with data in numerical arrays, but are very slow when working with other
data structures. Anything that can be written as an operation on numerical arrays can
be done at lightning speed on a GPU.
- GPUs are only efficient on arrays and ndarrays
What essentially are ndarrays?
entire spreadsheets in a variable, on which we can perform all standard spreadsheet operations on
What is a vector?
a simple array
What is a matrix ?
2d array
What is a tensor?
Any rectangular array-like structure with more than 2 dimensions.
What should we think of tensors as ?
arrays of matrices or vectors
What are axes?
a specific dimension in an array / ndarray. These are indexed 0 to n, where n is the number of dimensions
Possible operations on ndarrays?
- create
- arithmetic
- indexing
- slicing
- rearrangement
- order operations e.g.sorting
- aggregate functions
- vector operations
- matrix operations
- signal processing operations
What is the only thing ndarrays can hold?
numbers , either floats or ints
What do ndarrays have?
shape and size
Do ndarrays have to be rectangular?
YES
Can ndarrays be changed in terms of size?
nah
Are ndarrays mutable tho?
yes
Are ndarrays dynamically typed?
no, statically
Why are ndarrays statically typed?
Since the values in the ndarrays are not actually e.g.Python values, but raw blocks numbers from memory.