import numpy as np

### Werte initialisieren ###
shape = (2, 2)
np.full(shape, 5)   # 2x2 Array: überall 5
np.zeros(shape)     # 2x2 Array: überall 0 <=> np.ones

### Array aus Liste ###
python_liste = [[5, 5], [5, 5]]
np.array(python_liste)  # Python-Liste zu Array

### Array aus range ###
zero_to_eight = np.arange(9)  # [0,..., 8]
arr3x3 = zero_to_eight.reshape((3, 3))

### Operationen auf Arrays ###
arr3x3.max()    # maximaler Wert
arr3x3.min()    # min. Wert
arr3x3.mean()   # Mittelwert
arr3x3.sum()    # Summe allert Werte
arr3x3.shape    # (3, 3) Form/Dimensionen

np.argmax(arr3x3)          # IndexMax in "flachem" Array
np.argmax(arr3x3, axis=0)  # "argmax pro Spalte"


### Operatorüberladung ###
# + - * / und weitere
two2x2 = np.ones((2, 2)) * 2    # Alle Werte mal 2

four2x2 = two2x2 + two2x2       # Array addition

58ccafc5044b6c99b425ad02d7128c8ad5c26fd8
<mask token>

<mask token>
np.full(shape, 5)
np.zeros(shape)
<mask token>
np.array(python_liste)
<mask token>
arr3x3.max()
arr3x3.min()
arr3x3.mean()
arr3x3.sum()
arr3x3.shape
np.argmax(arr3x3)
np.argmax(arr3x3, axis=0)
<mask token>

<mask token>
shape = 2, 2
np.full(shape, 5)
np.zeros(shape)
python_liste = [[5, 5], [5, 5]]
np.array(python_liste)
zero_to_eight = np.arange(9)
arr3x3 = zero_to_eight.reshape((3, 3))
arr3x3.max()
arr3x3.min()
arr3x3.mean()
arr3x3.sum()
arr3x3.shape
np.argmax(arr3x3)
np.argmax(arr3x3, axis=0)
two2x2 = np.ones((2, 2)) * 2
four2x2 = two2x2 + two2x2

import numpy as np
shape = 2, 2
np.full(shape, 5)
np.zeros(shape)
python_liste = [[5, 5], [5, 5]]
np.array(python_liste)
zero_to_eight = np.arange(9)
arr3x3 = zero_to_eight.reshape((3, 3))
arr3x3.max()
arr3x3.min()
arr3x3.mean()
arr3x3.sum()
arr3x3.shape
np.argmax(arr3x3)
np.argmax(arr3x3, axis=0)
two2x2 = np.ones((2, 2)) * 2
four2x2 = two2x2 + two2x2

import numpy as np

### Werte initialisieren ###
shape = (2, 2)
np.full(shape, 5)   # 2x2 Array: überall 5
np.zeros(shape)     # 2x2 Array: überall 0 <=> np.ones

### Array aus Liste ###
python_liste = [[5, 5], [5, 5]]
np.array(python_liste)  # Python-Liste zu Array

### Array aus range ###
zero_to_eight = np.arange(9)  # [0,..., 8]
arr3x3 = zero_to_eight.reshape((3, 3))

### Operationen auf Arrays ###
arr3x3.max()    # maximaler Wert
arr3x3.min()    # min. Wert
arr3x3.mean()   # Mittelwert
arr3x3.sum()    # Summe allert Werte
arr3x3.shape    # (3, 3) Form/Dimensionen

np.argmax(arr3x3)          # IndexMax in "flachem" Array
np.argmax(arr3x3, axis=0)  # "argmax pro Spalte"


### Operatorüberladung ###
# + - * / und weitere
two2x2 = np.ones((2, 2)) * 2    # Alle Werte mal 2

four2x2 = two2x2 + two2x2       # Array addition
