hat schonmal wer mit dieser Funktion gearbeitet?
numpy.lib.stride_tricks.as_strided
Verstehe nicht ganz was hier ausgegeben wird:
Code: Alles auswählen
import numpy as np
window=3
a= np.arange(12)
shape = a.shape[:-1] + (a.shape[-1] - window + 1, window)
strides = a.strides + (a.strides[-1],)
x=np.lib.stride_tricks.as_strided(a, shape=shape, strides=strides)
print(x)
Code: Alles auswählen
import numpy as np
window=3
a= np.arange(12)
shape = a.shape[:-1] + (a.shape[-1] - window + 1, window)
strides = a.strides + (a.strides[-1],)
x=np.lib.stride_tricks.as_strided(a, shape=shape, strides=strides)
y=np.max(x)
print(y)
Ich möchte später jedoch einen Block mit dem darauffolgenden Block vergleichen, da stehe ich gerade auf dem Schlauch.
Danke schonmal für die Antwort
Grüße
Sw1p3