Reputation: 11
Code example:
>>> import sympy.physics.units as u
>>> 10*u.cm > 20*u.mm
10*centimeter > 20*milimeter
However, I want to return a boolean.
Upvotes: 0
Views: 42
Reputation: 11
I found an easier solution to just use a package called pint. This package was created especially for manipulation of physics units.
>>> from pint import UnitRegistry
>>> ureg = UnitRegistry()
>>> 10*ureg.cm > 10*ureg.mm
True
Upvotes: 1