You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When applying delta to Numpy arrays, make sure to put the delta object first and the numpy array second. This is because Numpy array overrides the + operator and thus DeepDiff's Delta won't be able to be applied.
deepdiff.delta.DeltaNumpyOperatorOverrideError: A numpy ndarray is most likely being added to a delta. Due to Numpy override the + operator, you can only do: delta + ndarray and NOT ndarray + delta
221
+
222
+
Let's put the delta first then:
223
+
224
+
>>> delta + t1
225
+
array([2, 2, 7, 5])
226
+
>>> delta + t2 == t2
227
+
array([ True, True, True, True])
228
+
174
229
175
230
.. note::
176
231
You can not apply a delta that was created from normal Python objects to Numpy arrays.
0 commit comments