Articles → Numpy → Modf Function In Numpy

Modf Function In Numpy






Purpose




  1. An integral part i.e., the number on the left-hand side of the decimal.
  2. A fractional part i.e., a number on the right-hand side of the decimal.





Example


import numpy as np

print("modf of 3.7 is :", np.modf(3.7))
print("modf of 1 is :", np.modf(1))
print("modf of -5.1 is :", np.modf(-5.1))



Output


Picture showing the output of the modf function in numpy
Click to Enlarge


Posted By  -  Karan Gupta
 
Posted On  -  Friday, June 7, 2019

Query/Feedback


Your Email Id
 
Subject
 
Query/FeedbackCharacters remaining 250