About 16,500,000 results
Open links in new tab
  1. python - Taking the floor of a float - Stack Overflow

    Feb 23, 2012 · import math math.floor(3.1415) The problem with the first approach is that it return a float (namely 3.0). The second approach feels clumsy and too long. Are there alternative …

  2. math - `/` vs `//` for division in Python - Stack Overflow

    In Python 3.x, 5 / 2 will return 2.5 and 5 // 2 will return 2. The former is floating point division, and the latter is floor division, sometimes also called integer division. In Python 2.2 or later in the …

  3. What is the difference between int() and floor() in Python 3?

    5 Rounding down can be done in many ways, some methods are equivalent, e.g. built-in int, numpy.trunc and numpy.fix which truncate the number, meaning for a negative number they …

  4. Why do Python's math.ceil() and math.floor() operations return …

    Dec 21, 2011 · The python functions are wrappers of the C function and so this is really a deficiency of the C functions where they should have returned an integer and forced the …

  5. Ceil and floor equivalent in Python 3 without Math module?

    Sep 14, 2015 · Ceil and floor equivalent in Python 3 without Math module? Asked 10 years, 2 months ago Modified 3 years, 6 months ago Viewed 73k times

  6. python - floor and ceil with number of decimals - Stack Overflow

    Sep 23, 2019 · The function np.round accepts a decimals parameter but it appears that the functions ceil and floor don't accept a number of decimals and always return a number with …

  7. python - How do you round UP a number? - Stack Overflow

    May 5, 2017 · The // operator always rounds down, so x // 1 = floor (x). Therefore, the logic here to round the negated number down, then negate again, which results in rounding up the …

  8. Floor or ceiling of a pandas series in python? - Stack Overflow

    Dec 21, 2014 · I have a pandas series series. If I want to get the element-wise floor or ceiling, is there a built in method or do I have to write the function and use apply? I ask because the data …

  9. rounding - round down to 2 decimal in python - Stack Overflow

    I need to round down and it should be two decimal places. Tried the following, a = 28.266 print round(a, 2) 28.27 But the expected value is 28.26 only.

  10. How to round the minute of a datetime object - Stack Overflow

    173 This will get the 'floor' of a datetime object stored in tm rounded to the 10 minute mark before tm.