Deepdiff

DeepDiff Tutorial: Comparing Numbers

python deepdiff tutorial
This tutorial is written based on DeepDiff 4.0.6. One of the features of DeepDiff that comes very handy is comparying nested data structures that include numbers. There are times that we do care about the exact numbers and want it to be reported if anything slightly changed. from pprint import pprint from deepdiff import DeepDiff t1 = {"key": [1.2, 1.5]} t2 = {"key": [1.20, 1.50]} >>> pprint(DeepDiff(t1, t2)) {} Let’s say the numbers gets more precise:
Read more