def logspace(start, stop, num=50, endpoint=True, base=10.0):
    '''Create a 1D dataset of values equally spaced on a logarithmic scale'''
    if complex(start).imag == 0 and complex(stop).imag == 0:
        return _dsutils.logSpace(start, stop, num, base, endpoint)
    else:
        result = linspace(start, stop, num, endpoint)
        return _maths.power(base, result)
def logspace(start, stop, num=50, endpoint=True, base=10.0):
    '''Create a 1D dataset of values equally spaced on a logarithmic scale'''
    if not endpoint:
        stop = ((num - 1) * stop + start)/num

    if complex(start).imag == 0 and complex(stop).imag == 0:
        dtype = _getdtypefromobj(((start, stop)))
        return _dsutils.logSpace(start, stop, num, base, dtype.value)
    else:
        result = linspace(start, stop, num, endpoint)
        return _maths.power(base, result)
Exemple #3
0
def logspace(start, stop, num=50, endpoint=True, base=10.0):
    '''Create a 1D dataset of values equally spaced on a logarithmic scale'''
    if not endpoint:
        stop = ((num - 1) * stop + start) / num

    if complex(start).imag == 0 and complex(stop).imag == 0:
        dtype = _getdtypefromobj(((start, stop)))
        return _dsutils.logSpace(start, stop, num, base, dtype.value)
    else:
        result = linspace(start, stop, num, endpoint)
        return _maths.power(base, result)
Exemple #4
0
def logspace(start, stop, num=50, endpoint=True, base=10.0, dtype=None):
    '''Create a 1D dataset of values equally spaced on a logarithmic scale'''
    if not endpoint:
        stop = ((num - 1) * stop + start)/num

    dtype = _translatenativetype(dtype)
    if complex(start).imag == 0 and complex(stop).imag == 0:
        if dtype is None:
            dtype = _getdtypefromobj(((start, stop)))

            if dtype.value < float64.value:
                dtype = float64

        return _df.createLogSpace(start, stop, num, base, dtype.value)
    else:
        result = linspace(start, stop, num, endpoint, False, dtype)
        return _maths.power(base, result)
Exemple #5
0
 def __pow__(self, o, z=None):
     return _maths.power(self, asDataset(o))