Re: [Numpy-discussion] padding options for diff

Oct. 26, 2016
3:35 p.m.
So my suggestion was intended that you might want an additional keyword argument (keep_left=False) to make the inverse np.cumsum use-case easier, i.e. you would have something in your np.diff like: if keep_left: if to_begin is None: to_begin = np.take(a, [0], axis=axis) else: raise ValueError(‘np.diff(a, keep_left=False, to_begin=None) can be used with either keep_left or to_begin, but not both.’) Generally I try to avoid optional keyword argument overlap, but in this case it is probably justified. Peter
3061
Age (days ago)
3061
Last active (days ago)
1 comments
2 participants
participants (2)
-
Matthew Harrigan
-
Peter Creasey