Skip to content

Instantly share code, notes, and snippets.

@btotr
Created December 19, 2022 12:11
Show Gist options
  • Save btotr/5ac4101f25515ca8b09e5550a515cb4f to your computer and use it in GitHub Desktop.
Save btotr/5ac4101f25515ca8b09e5550a515cb4f to your computer and use it in GitHub Desktop.
import numpy as np
def window(slope, size=20):
std=[0]*round(len(slope)/(size))
p = 0
for i in range(0, len(slope)-size, size):
k=[0]*(size+1)
for t in (0, size):
k[t] = slope[i+t]
std[p] = np.max(k) - np.min(k)
print(np.max(k), np.min(k), std[p] )
p = p + 1
return std
windowSlope = np.array(window(GC.series(GC.SERIES_SLOPE),50))
print(np.std(windowSlope))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment