本文整理匯總了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