
def round_up(ar, ndecimals=2):
    '''Rounds up an array'''

    from numpy import vectorize

    def _round_up(number, _ndecimals):

        from math import ceil

        factor = 10**_ndecimals

        return ceil(number*factor)/factor

    return vectorize(_round_up)(ar, ndecimals)


# least common multiple isn't available before NumPy v1.15 or Python v3.9 (in math)
def lcm(*args) -> int:
    '''Least common multiple'''

    from math import gcd

    lcm = args[0]

    # math.gcd() doesn't support more than two integers until Python v3.9
    for i in args[1:]:
      lcm = lcm*i // gcd(lcm, i)

    return lcm

