Dummy object that raises an ImportError if ctypes is not available.
Raises: | ImportError :
|
---|
Dummy object that raises an ImportError if ctypes is not available.
Raises: | ImportError :
|
---|
Dummy object that raises an ImportError if ctypes is not available.
Raises: | ImportError :
|
---|
Dummy object that raises an ImportError if ctypes is not available.
Raises: | ImportError :
|
---|
Array-checking restype/argtypes.
An ndpointer instance is used to describe an ndarray in restypes and argtypes specifications. This approach is more flexible than using, for example, POINTER(c_double), since several restrictions can be specified, which are verified upon calling the ctypes function. These include data type, number of dimensions, shape and flags. If a given array does not satisfy the specified restrictions, a TypeError is raised.
Parameters: | dtype : data-type, optional
ndim : int, optional
shape : tuple of ints, optional
flags : str or tuple of str
|
---|---|
Returns: | klass : ndpointer type object
|
Raises: | TypeError :
|
Examples
>>> clib.somefunc.argtypes = [np.ctypeslib.ndpointer(dtype=np.float64,
... ndim=1,
... flags='C_CONTIGUOUS')]
>>> clib.somefunc(np.array([1, 2, 3], dtype=np.float64))