'How to get root using DeepDiff
I'm currently working with DeepDiff where I'm trying to figure out how I can get the value of the root instead of printing out the root e.g.
Value of root['hello'][0]['hello_world'] changed from "15251" to "51251".
So I have made a simple script
from deepdiff import DeepDiff
dict_a = {'hello': [{'what': 'uh', 'hello_world': '15251'}]}
dict_b = {'hello': [{'hello_world': '51251', 'what': 'uh'}]}
t = DeepDiff(dict_a, dict_b, ignore_order=True)
print(t.pretty())
>>> Value of root['hello'][0]['hello_world'] changed from "15251" to "51251".
and the output that I want to do is that I want it to be able to print out root['hello'][0] so in our case that would be dict_b['hello'][0] >>> {'hello_world': '51251', 'what': 'uh'} so that I can easily track in my dict_b the whole list rather than just the value
Is it possible to do this using DeepDiff?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
