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


Python DatasetUtils.createCompoundDataset方法代码示例

本文整理汇总了Python中org.eclipse.january.dataset.DatasetUtils.createCompoundDataset方法的典型用法代码示例。如果您正苦于以下问题:Python DatasetUtils.createCompoundDataset方法的具体用法?Python DatasetUtils.createCompoundDataset怎么用?Python DatasetUtils.createCompoundDataset使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.eclipse.january.dataset.DatasetUtils的用法示例。


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

示例1: linspace

# 需要导入模块: from org.eclipse.january.dataset import DatasetUtils [as 别名]
# 或者: from org.eclipse.january.dataset.DatasetUtils import createCompoundDataset [as 别名]
def linspace(start, stop, num=50, endpoint=True, retstep=False, dtype=None):
    '''Create a 1D dataset from start to stop in given number of steps
    
    Arguments:
    start    -- starting value
    stop     -- stopping value
    num      -- number of steps, defaults to 50
    endpoint -- if True (default), include the stop value
    retstep  -- if False (default), do not include the calculated step value as part of return tuple
    '''
    if not endpoint:
        stop = ((num - 1) * stop + start)/num

    dtype = _translatenativetype(dtype)
    if dtype is None:
        dtype = _getdtypefromobj(((start, stop)))

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

    if dtype.value >= complex64.value:
        dtype = complex128

        if type(start) is _types.IntType:
            start = start+0j
        if type(stop) is _types.IntType:
            stop = stop+0j
        rresult = _df.createLinearSpace(start.real, stop.real, num, float64.value)
        iresult = _df.createLinearSpace(start.imag, stop.imag, num, float64.value)
        result = Sciwrap(_dsutils.createCompoundDataset(complex128.value, (rresult, iresult)))
        del rresult, iresult
    else:
        result = Sciwrap(_df.createLinearSpace(start, stop, num, dtype.value))

    if retstep:
        step = result[1] - result[0]
        return (result, step)
    else:
        return result
开发者ID:mtwharmby,项目名称:daq-eclipse,代码行数:41,代码来源:jycore.py


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