Skip to content
Snippets Groups Projects
Commit 8e1f2d01 authored by Mads M. Pedersen's avatar Mads M. Pedersen
Browse files

notimplementederror for unknown 'type'-argument in _differentiation.py

parent 5adc82b2
No related branches found
No related tags found
No related merge requests found
...@@ -40,8 +40,10 @@ def differentiation(x, type='center', sample_frq=None, cutoff_frq=None): ...@@ -40,8 +40,10 @@ def differentiation(x, type='center', sample_frq=None, cutoff_frq=None):
x = np.array(x) x = np.array(x)
if type=="left": if type=="left":
dy = np.r_[np.nan, x[1:]-x[:-1]] dy = np.r_[np.nan, x[1:]-x[:-1]]
if type=="center": elif type=="center":
dy = np.r_[x[1]-x[0], (x[2:]-x[:-2])/2, x[-1]-x[-2]] dy = np.r_[x[1]-x[0], (x[2:]-x[:-2])/2, x[-1]-x[-2]]
if type=="right": elif type=="right":
dy = np.r_[x[1:]-x[:-1], np.nan] dy = np.r_[x[1:]-x[:-1], np.nan]
else:
raise NotImplementedError()
return dy return dy
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment