deepdiff icon indicating copy to clipboard operation
deepdiff copied to clipboard

[not a bug,but help]how can i get the compare level path

Open su9695 opened this issue 3 years ago • 0 comments

EX: a = [1,2,3, {'c1':1,'b':'2','a':'3'}] b = [3,4,5,{'a':3,'b':'4','c':'5'}]

d_result = DeepDiff(a,b,ignore_order=True,cutoff_distance_for_pairs=1,cutoff_intersection_for_pairs=0.7) pprint(d_result)

result is : {'dictionary_item_added': [root[3]['c']], 'dictionary_item_removed': [root[3]['c1']], 'type_changes': {"root[3]['a']": {'new_type': <class 'int'>, 'new_value': 3, 'old_type': <class 'str'>, 'old_value': '3'}}, 'values_changed': {'root[0]': {'new_value': 5, 'old_value': 1}, 'root[1]': {'new_value': 4, 'old_value': 2}, "root[3]['b']": {'new_value': '4', 'old_value': '2'}}}

now i can only get values_changed path .such as root[0](old_value 1 ),this is one path of dict a,how can i get the compare path of dict b (new value 5) at the same time ;without using DeepSearch secondary。。

su9695 avatar Aug 09 '22 10:08 su9695