当前位置: 首页>>代码示例>>Python>>正文


Python dataset.Maths类代码示例

本文整理汇总了Python中uk.ac.diamond.scisoft.analysis.dataset.Maths的典型用法代码示例。如果您正苦于以下问题:Python Maths类的具体用法?Python Maths怎么用?Python Maths使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了Maths类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: gradient

def gradient(f, *varargs):
    '''Gradient of array
    
    f -- array
    *varargs -- 0, 1, N scalars for sample distance, or (1 or N-d) datasets for sample points
    '''

    if varargs is None or len(varargs) == 0:
        g = _maths.gradient(f)
    else:
        # check for scalars, etc
        from jycore import arange as _ar
        vl = len(varargs)
        nd = f.getRank()
        if vl == 1:
            varargs = [varargs[0]]*nd
            vl = nd
        if vl != nd:
            raise ValueError, "Number of arguments must be 0, 1 or rank of f"

        xlist = []
        for i in range(vl):
            x = varargs[i]
            xlist.append(x if isinstance(x, _ads) else (_ar(f.shape[i])*x)._jdataset())
        g = _maths.gradient(f, xlist)

    if len(g) == 1:
        return g[0]
    return g
开发者ID:thiyagavit,项目名称:passerelle,代码行数:29,代码来源:jymaths.py

示例2: tanh

def tanh(a):
    '''Hyperbolic tangent of input'''
    return _maths.tanh(a)
开发者ID:olofsvensson,项目名称:scisoft-core,代码行数:3,代码来源:jymaths.py

示例3: floor_divide

def floor_divide(a, b):
    '''Calculate largest integers smaller or equal to division'''
    return _maths.floorDivide(a, b)
开发者ID:olofsvensson,项目名称:scisoft-core,代码行数:3,代码来源:jymaths.py

示例4: divide

def divide(a, b):
    '''Divide one array-like object by another'''
    return _maths.divide(a, b)
开发者ID:olofsvensson,项目名称:scisoft-core,代码行数:3,代码来源:jymaths.py

示例5: subtract

def subtract(a, b):
    '''Subtract one array-like object from another'''
    return _maths.subtract(a, b)
开发者ID:olofsvensson,项目名称:scisoft-core,代码行数:3,代码来源:jymaths.py

示例6: diff

def diff(a, order=1, axis=-1):
    '''Difference of input'''
    return _maths.difference(a, order, axis)
开发者ID:olofsvensson,项目名称:scisoft-core,代码行数:3,代码来源:jymaths.py

示例7: negative

def negative(a):
    '''Negate input'''
    return _maths.negative(a)
开发者ID:olofsvensson,项目名称:scisoft-core,代码行数:3,代码来源:jymaths.py

示例8: deg2rad

def deg2rad(a):
    '''Convert from degree to radian'''
    return _maths.toRadians(a)
开发者ID:olofsvensson,项目名称:scisoft-core,代码行数:3,代码来源:jymaths.py

示例9: exp

def exp(a):
    '''Exponential of input'''
    return _maths.exp(a)
开发者ID:olofsvensson,项目名称:scisoft-core,代码行数:3,代码来源:jymaths.py

示例10: log1p

def log1p(x):
    '''Natural logarithm of (x+1)'''
    return _maths.log1p(x)
开发者ID:olofsvensson,项目名称:scisoft-core,代码行数:3,代码来源:jymaths.py

示例11: log10

def log10(a):
    '''Logarithm of input to base 10'''
    return _maths.log10(a)
开发者ID:olofsvensson,项目名称:scisoft-core,代码行数:3,代码来源:jymaths.py

示例12: log2

def log2(a):
    '''Logarithm of input to base 2'''
    return _maths.log2(a)
开发者ID:olofsvensson,项目名称:scisoft-core,代码行数:3,代码来源:jymaths.py

示例13: log

def log(a):
    '''Natural logarithm of input'''
    return _maths.log(a)
开发者ID:olofsvensson,项目名称:scisoft-core,代码行数:3,代码来源:jymaths.py

示例14: arctanh

def arctanh(a):
    '''Inverse hyperbolic tangent of input'''
    return _maths.arctanh(a)
开发者ID:olofsvensson,项目名称:scisoft-core,代码行数:3,代码来源:jymaths.py

示例15: arccosh

def arccosh(a):
    '''Inverse hyperbolic cosine of input'''
    return _maths.arccosh(a)
开发者ID:olofsvensson,项目名称:scisoft-core,代码行数:3,代码来源:jymaths.py


注:本文中的uk.ac.diamond.scisoft.analysis.dataset.Maths类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。