For example, when I calculate 98/42
I want to get 7/3
, not 2.3333333
, is there a function for that using Python or Numpy
?
相关问题
- how to define constructor for Python's new Nam
- streaming md5sum of contents of a large remote tar
- How to get the background from multiple images by
- Evil ctypes hack in python
- Correctly parse PDF paragraphs with Python
The
fractions
module can do thatThere's a recipe over here for a numpy gcd. Which you could then use to divide your fraction