本文整理汇总了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