Last active
December 6, 2020 06:19
-
-
Save asifr/d77a1725c47115a1f400c7231f6c9c97 to your computer and use it in GitHub Desktop.
Revisions
-
asifr revised this gist
Dec 6, 2020 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,5 @@ import numpy as np def resample(x, t, start, end, step): bins = np.arange(start, end+step, step) inds = np.digitize(t,bins) -
asifr revised this gist
Dec 5, 2020 . 1 changed file with 5 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,10 +1,13 @@ def resample(x, t, start, end, step): bins = np.arange(start, end+step, step) inds = np.digitize(t,bins) n = x.shape[0] y = np.empty((n, len(bins))) * np.nan for i in range(n): y[i,inds[i,:]] = x[i,:] return y, bins x = [3,6,9,12,15,18,21,24] t = [0,4,8,10,45,67,78,90] x_re, t_re = resample(x, t, 0, 100, 5) -
asifr created this gist
Dec 5, 2020 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,10 @@ def resample(x, t, start, end, step): bins = np.arange(start, end+step, step) inds = np.digitize(t,bins) y = np.empty(len(bins)) * np.nan y[inds] = x return y, bins x = [3,6,9,12,15,18,21,24] t = [0,4,8,10,45,67,78,90] x_re, t_re = resample(x, t, 0, 100, 5)