@@ -634,7 +634,7 @@ def diff(arr, n, axis=0):
634
634
res_indexer = tuple (res_indexer )
635
635
636
636
lag_indexer = [slice (None )] * arr .ndim
637
- lag_indexer [axis ] = slice (None , - n ) if n >= 0 else slice (- n , None )
637
+ lag_indexer [axis ] = slice (None , - n ) if n > 0 else slice (- n , None )
638
638
lag_indexer = tuple (lag_indexer )
639
639
640
640
out_arr [res_indexer ] = arr [res_indexer ] - arr [lag_indexer ]
@@ -763,7 +763,7 @@ def changeit():
763
763
# our type is wrong here, need to upcast
764
764
r , fill_value = _maybe_upcast (result , fill_value = other , dtype = dtype , copy = True )
765
765
np .putmask (r , mask , other )
766
-
766
+
767
767
# we need to actually change the dtype here
768
768
if change is not None :
769
769
change .dtype = r .dtype
@@ -778,7 +778,7 @@ def changeit():
778
778
new_dtype , fill_value = _maybe_promote (result .dtype ,other )
779
779
if new_dtype != result .dtype :
780
780
781
- # we have a scalar or len 0 ndarray
781
+ # we have a scalar or len 0 ndarray
782
782
# and its nan and we are changing some values
783
783
if np .isscalar (other ) or (isinstance (other ,np .ndarray ) and other .ndim < 1 ):
784
784
if isnull (other ):
0 commit comments