Ejemplo n.º 1
0
def array(arg, dtype=None):
    """Create N-dimensional array from data
    
       Example:
          array([1, 2, 3])
          array([ [1, 2], [3, 4]])
    """
    if dtype is None:
        return ndarray(NDArray.create(arg))
    return ndarray(NDArray.create(arg, dtype))
Ejemplo n.º 2
0
def array(arg, dtype=None):
    """Create N-dimensional array from data
    
       Example:
          array([1, 2, 3])
          array([ [1, 2], [3, 4]])
    """
    if dtype is None:
        return ndarray(NDArray.create(arg))
    return ndarray(NDArray.create(arg, dtype))
Ejemplo n.º 3
0
def array(arg, dtype=None):
    """Create N-dimensional array from data
    
       Example:
          array([1, 2, 3])
          array([ [1, 2], [3, 4]])
    """
    if dtype is None:
        if isinstance(arg, ndarray):
            return ndarray(arg.nda.clone())
        else:
            return ndarray(NDArray.create(arg))
    return ndarray(NDArray.create(arg, dtype))
Ejemplo n.º 4
0
def array(arg, dtype=None):
    """Create N-dimensional array from data
    
       Example:
          array([1, 2, 3])
          array([ [1, 2], [3, 4]])
    """
    if dtype is None:
        if isinstance(arg, ndarray):
            return ndarray(arg.nda.clone())
        else:
            return ndarray(NDArray.create(arg))
    return ndarray(NDArray.create(arg, dtype))