numpy
2.0.0
|
#include <stdarg.h>
#include <Python.h>
#include "structmember.h"
#include "numpy/arrayobject.h"
#include "numpy/arrayscalars.h"
#include "npy_config.h"
#include "npy_pycompat.h"
#include "common.h"
#include "ctors.h"
#include "calculation.h"
#include "convert_datatype.h"
#include "item_selection.h"
#include "conversion_utils.h"
#include "shape.h"
#include "methods.h"
#include <stdio.h>
Defines | |
#define | PY_SSIZE_T_CLEAN |
#define | NPY_NO_DEPRECATED_API NPY_API_VERSION |
#define | _MULTIARRAYMODULE |
#define | NPY_FORWARD_NDARRAY_METHOD(name) |
#define | _CHKTYPENUM(typ) ((typ) ? (typ)->type_num : NPY_NOTYPE) |
Functions | |
static int | NpyArg_ParseKeywords (PyObject *keys, const char *format, char **kwlist,...) |
static PyObject * | get_forwarding_ndarray_method (const char *name) |
static PyObject * | forward_ndarray_method (PyArrayObject *self, PyObject *args, PyObject *kwds, PyObject *forwarding_callable) |
static PyObject * | array_take (PyArrayObject *self, PyObject *args, PyObject *kwds) |
static PyObject * | array_fill (PyArrayObject *self, PyObject *args) |
static PyObject * | array_put (PyArrayObject *self, PyObject *args, PyObject *kwds) |
static PyObject * | array_reshape (PyArrayObject *self, PyObject *args, PyObject *kwds) |
static PyObject * | array_squeeze (PyArrayObject *self, PyObject *args, PyObject *kwds) |
static PyObject * | array_view (PyArrayObject *self, PyObject *args, PyObject *kwds) |
static PyObject * | array_argmax (PyArrayObject *self, PyObject *args, PyObject *kwds) |
static PyObject * | array_argmin (PyArrayObject *self, PyObject *args, PyObject *kwds) |
static PyObject * | array_max (PyArrayObject *self, PyObject *args, PyObject *kwds) |
static PyObject * | array_min (PyArrayObject *self, PyObject *args, PyObject *kwds) |
static PyObject * | array_ptp (PyArrayObject *self, PyObject *args, PyObject *kwds) |
static PyObject * | array_swapaxes (PyArrayObject *self, PyObject *args) |
NPY_NO_EXPORT PyObject * | PyArray_GetField (PyArrayObject *self, PyArray_Descr *typed, int offset) |
static PyObject * | array_getfield (PyArrayObject *self, PyObject *args, PyObject *kwds) |
NPY_NO_EXPORT int | PyArray_SetField (PyArrayObject *self, PyArray_Descr *dtype, int offset, PyObject *val) |
static PyObject * | array_setfield (PyArrayObject *self, PyObject *args, PyObject *kwds) |
NPY_NO_EXPORT PyObject * | PyArray_Byteswap (PyArrayObject *self, npy_bool inplace) |
static PyObject * | array_byteswap (PyArrayObject *self, PyObject *args) |
static PyObject * | array_tolist (PyArrayObject *self, PyObject *args) |
static PyObject * | array_tostring (PyArrayObject *self, PyObject *args, PyObject *kwds) |
static PyObject * | array_tofile (PyArrayObject *self, PyObject *args, PyObject *kwds) |
static PyObject * | array_toscalar (PyArrayObject *self, PyObject *args) |
static PyObject * | array_setscalar (PyArrayObject *self, PyObject *args) |
NPY_NO_EXPORT const char * | npy_casting_to_string (NPY_CASTING casting) |
static PyObject * | array_astype (PyArrayObject *self, PyObject *args, PyObject *kwds) |
static PyObject * | array_wraparray (PyArrayObject *self, PyObject *args) |
static PyObject * | array_preparearray (PyArrayObject *self, PyObject *args) |
static PyObject * | array_getarray (PyArrayObject *self, PyObject *args) |
static PyObject * | array_copy (PyArrayObject *self, PyObject *args, PyObject *kwds) |
static PyObject * | array_resize (PyArrayObject *self, PyObject *args, PyObject *kwds) |
static PyObject * | array_repeat (PyArrayObject *self, PyObject *args, PyObject *kwds) |
static PyObject * | array_choose (PyArrayObject *self, PyObject *args, PyObject *kwds) |
static PyObject * | array_sort (PyArrayObject *self, PyObject *args, PyObject *kwds) |
static PyObject * | array_argsort (PyArrayObject *self, PyObject *args, PyObject *kwds) |
static PyObject * | array_searchsorted (PyArrayObject *self, PyObject *args, PyObject *kwds) |
static void | _deepcopy_call (char *iptr, char *optr, PyArray_Descr *dtype, PyObject *deepcopy, PyObject *visit) |
static PyObject * | array_deepcopy (PyArrayObject *self, PyObject *args) |
static PyObject * | _getlist_pkl (PyArrayObject *self) |
static int | _setlist_pkl (PyArrayObject *self, PyObject *list) |
static PyObject * | array_reduce (PyArrayObject *self, PyObject *NPY_UNUSED(args)) |
static PyObject * | array_setstate (PyArrayObject *self, PyObject *args) |
NPY_NO_EXPORT int | PyArray_Dump (PyObject *self, PyObject *file, int protocol) |
NPY_NO_EXPORT PyObject * | PyArray_Dumps (PyObject *self, int protocol) |
static PyObject * | array_dump (PyArrayObject *self, PyObject *args) |
static PyObject * | array_dumps (PyArrayObject *self, PyObject *args) |
static PyObject * | array_transpose (PyArrayObject *self, PyObject *args) |
static PyObject * | array_mean (PyArrayObject *self, PyObject *args, PyObject *kwds) |
static PyObject * | array_sum (PyArrayObject *self, PyObject *args, PyObject *kwds) |
static PyObject * | array_cumsum (PyArrayObject *self, PyObject *args, PyObject *kwds) |
static PyObject * | array_prod (PyArrayObject *self, PyObject *args, PyObject *kwds) |
static PyObject * | array_cumprod (PyArrayObject *self, PyObject *args, PyObject *kwds) |
static PyObject * | array_dot (PyArrayObject *self, PyObject *args, PyObject *kwds) |
static PyObject * | array_any (PyArrayObject *self, PyObject *args, PyObject *kwds) |
static PyObject * | array_all (PyArrayObject *self, PyObject *args, PyObject *kwds) |
static PyObject * | array_stddev (PyArrayObject *self, PyObject *args, PyObject *kwds) |
static PyObject * | array_variance (PyArrayObject *self, PyObject *args, PyObject *kwds) |
static PyObject * | array_compress (PyArrayObject *self, PyObject *args, PyObject *kwds) |
static PyObject * | array_nonzero (PyArrayObject *self, PyObject *args) |
static PyObject * | array_trace (PyArrayObject *self, PyObject *args, PyObject *kwds) |
static PyObject * | array_clip (PyArrayObject *self, PyObject *args, PyObject *kwds) |
static PyObject * | array_conjugate (PyArrayObject *self, PyObject *args) |
static PyObject * | array_diagonal (PyArrayObject *self, PyObject *args, PyObject *kwds) |
static PyObject * | array_flatten (PyArrayObject *self, PyObject *args, PyObject *kwds) |
static PyObject * | array_ravel (PyArrayObject *self, PyObject *args, PyObject *kwds) |
static PyObject * | array_round (PyArrayObject *self, PyObject *args, PyObject *kwds) |
static PyObject * | array_setflags (PyArrayObject *self, PyObject *args, PyObject *kwds) |
static PyObject * | array_newbyteorder (PyArrayObject *self, PyObject *args) |
Variables | |
NPY_NO_EXPORT PyMethodDef | array_methods [] |
#define _CHKTYPENUM | ( | typ | ) | ((typ) ? (typ)->type_num : NPY_NOTYPE) |
Referenced by PyArray_Dump().
#define _MULTIARRAYMODULE |
#define NPY_FORWARD_NDARRAY_METHOD | ( | name | ) |
static PyObject *callable = NULL; \ if (callable == NULL) { \ callable = get_forwarding_ndarray_method(name); \ if (callable == NULL) { \ return NULL; \ } \ } \ return forward_ndarray_method(self, args, kwds, callable)
Referenced by array_argmin(), and array_dumps().
#define NPY_NO_DEPRECATED_API NPY_API_VERSION |
#define PY_SSIZE_T_CLEAN |
static void _deepcopy_call | ( | char * | iptr, |
char * | optr, | ||
PyArray_Descr * | dtype, | ||
PyObject * | deepcopy, | ||
PyObject * | visit | ||
) | [static] |
References PyArrayIterObject_tag::dataptr, PyArrayIterObject_tag::index, PyArray_DESCR, PyArray_ITER_NEXT, PyArray_IterNew(), and PyArrayIterObject_tag::size.
Referenced by array_argsort().
static PyObject* _getlist_pkl | ( | PyArrayObject * | self | ) | [static] |
static int _setlist_pkl | ( | PyArrayObject * | self, |
PyObject * | list | ||
) | [static] |
static PyObject* array_all | ( | PyArrayObject * | self, |
PyObject * | args, | ||
PyObject * | kwds | ||
) | [static] |
Referenced by array_round().
static PyObject* array_any | ( | PyArrayObject * | self, |
PyObject * | args, | ||
PyObject * | kwds | ||
) | [static] |
Referenced by array_round().
static PyObject* array_argmax | ( | PyArrayObject * | self, |
PyObject * | args, | ||
PyObject * | kwds | ||
) | [static] |
Referenced by array_round().
static PyObject* array_argmin | ( | PyArrayObject * | self, |
PyObject * | args, | ||
PyObject * | kwds | ||
) | [static] |
References NPY_FORWARD_NDARRAY_METHOD.
Referenced by array_round().
static PyObject* array_argsort | ( | PyArrayObject * | self, |
PyObject * | args, | ||
PyObject * | kwds | ||
) | [static] |
References _deepcopy_call(), and NPY_TITLE_KEY.
static PyObject* array_astype | ( | PyArrayObject * | self, |
PyObject * | args, | ||
PyObject * | kwds | ||
) | [static] |
Referenced by array_setflags().
static PyObject* array_byteswap | ( | PyArrayObject * | self, |
PyObject * | args | ||
) | [static] |
Referenced by array_setflags().
static PyObject* array_choose | ( | PyArrayObject * | self, |
PyObject * | args, | ||
PyObject * | kwds | ||
) | [static] |
Referenced by array_setflags().
static PyObject* array_clip | ( | PyArrayObject * | self, |
PyObject * | args, | ||
PyObject * | kwds | ||
) | [static] |
Referenced by array_setflags().
static PyObject* array_compress | ( | PyArrayObject * | self, |
PyObject * | args, | ||
PyObject * | kwds | ||
) | [static] |
References PyArray_OutputConverter(), PyArray_Return(), and PyArray_Round().
Referenced by array_setflags().
static PyObject* array_conjugate | ( | PyArrayObject * | self, |
PyObject * | args | ||
) | [static] |
Referenced by array_setflags().
static PyObject* array_copy | ( | PyArrayObject * | self, |
PyObject * | args, | ||
PyObject * | kwds | ||
) | [static] |
Referenced by array_flatten(), and array_setflags().
static PyObject* array_cumprod | ( | PyArrayObject * | self, |
PyObject * | args, | ||
PyObject * | kwds | ||
) | [static] |
Referenced by array_setflags().
static PyObject* array_cumsum | ( | PyArrayObject * | self, |
PyObject * | args, | ||
PyObject * | kwds | ||
) | [static] |
Referenced by array_setflags().
static PyObject* array_deepcopy | ( | PyArrayObject * | self, |
PyObject * | args | ||
) | [static] |
static PyObject* array_diagonal | ( | PyArrayObject * | self, |
PyObject * | args, | ||
PyObject * | kwds | ||
) | [static] |
Referenced by array_setflags().
static PyObject* array_dot | ( | PyArrayObject * | self, |
PyObject * | args, | ||
PyObject * | kwds | ||
) | [static] |
Referenced by array_setflags().
static PyObject* array_dump | ( | PyArrayObject * | self, |
PyObject * | args | ||
) | [static] |
static PyObject* array_dumps | ( | PyArrayObject * | self, |
PyObject * | args | ||
) | [static] |
References NPY_FORWARD_NDARRAY_METHOD.
Referenced by array_ravel().
static PyObject* array_fill | ( | PyArrayObject * | self, |
PyObject * | args | ||
) | [static] |
Referenced by array_setflags().
static PyObject* array_flatten | ( | PyArrayObject * | self, |
PyObject * | args, | ||
PyObject * | kwds | ||
) | [static] |
References array_copy(), array_preparearray(), and array_wraparray().
Referenced by array_setflags().
static PyObject* array_getarray | ( | PyArrayObject * | self, |
PyObject * | args | ||
) | [static] |
static PyObject* array_getfield | ( | PyArrayObject * | self, |
PyObject * | args, | ||
PyObject * | kwds | ||
) | [static] |
References _PyArray_Descr::elsize, NPY_ARRAY_UPDATE_ALL, Py_TYPE, PyArray_CopyObject(), PyArray_DATA, PyArray_DESCR, PyArray_DIMS, PyArray_FLAGS, PyArray_NDIM, PyArray_NewFromDescr(), PyArray_STRIDES, and PyArray_UpdateFlags().
Referenced by array_setflags().
static PyObject* array_max | ( | PyArrayObject * | self, |
PyObject * | args, | ||
PyObject * | kwds | ||
) | [static] |
Referenced by array_setflags().
static PyObject* array_mean | ( | PyArrayObject * | self, |
PyObject * | args, | ||
PyObject * | kwds | ||
) | [static] |
Referenced by array_setflags().
static PyObject* array_min | ( | PyArrayObject * | self, |
PyObject * | args, | ||
PyObject * | kwds | ||
) | [static] |
Referenced by array_setflags().
static PyObject* array_newbyteorder | ( | PyArrayObject * | self, |
PyObject * | args | ||
) | [static] |
References array_ptp(), array_put(), array_ravel(), array_repeat(), array_reshape(), and array_resize().
Referenced by array_setflags().
static PyObject* array_nonzero | ( | PyArrayObject * | self, |
PyObject * | args | ||
) | [static] |
References PyArray_FLAGS.
Referenced by array_setflags().
static PyObject* array_preparearray | ( | PyArrayObject * | self, |
PyObject * | args | ||
) | [static] |
static PyObject* array_prod | ( | PyArrayObject * | self, |
PyObject * | args, | ||
PyObject * | kwds | ||
) | [static] |
Referenced by array_setflags().
static PyObject* array_ptp | ( | PyArrayObject * | self, |
PyObject * | args, | ||
PyObject * | kwds | ||
) | [static] |
Referenced by array_newbyteorder().
static PyObject* array_put | ( | PyArrayObject * | self, |
PyObject * | args, | ||
PyObject * | kwds | ||
) | [static] |
Referenced by array_newbyteorder().
static PyObject* array_ravel | ( | PyArrayObject * | self, |
PyObject * | args, | ||
PyObject * | kwds | ||
) | [static] |
References array_dumps(), array_reduce(), and array_setstate().
Referenced by array_newbyteorder().
static PyObject* array_reduce | ( | PyArrayObject * | self, |
PyObject * | NPY_UNUSEDargs | ||
) | [static] |
5 arguments
5) a Python object representing the data (a string, or a list or any user-defined object).
Notice because Python does not describe a mechanism to write raw data to the pickle, this performs a copy to a string first
References PyArrayDescr_Type.
Referenced by array_ravel().
static PyObject* array_repeat | ( | PyArrayObject * | self, |
PyObject * | args, | ||
PyObject * | kwds | ||
) | [static] |
Referenced by array_newbyteorder().
static PyObject* array_reshape | ( | PyArrayObject * | self, |
PyObject * | args, | ||
PyObject * | kwds | ||
) | [static] |
Referenced by array_newbyteorder().
static PyObject* array_resize | ( | PyArrayObject * | self, |
PyObject * | args, | ||
PyObject * | kwds | ||
) | [static] |
Referenced by array_newbyteorder().
static PyObject* array_round | ( | PyArrayObject * | self, |
PyObject * | args, | ||
PyObject * | kwds | ||
) | [static] |
References array_all(), array_any(), array_argmax(), and array_argmin().
static PyObject* array_searchsorted | ( | PyArrayObject * | self, |
PyObject * | args, | ||
PyObject * | kwds | ||
) | [static] |
static PyObject* array_setfield | ( | PyArrayObject * | self, |
PyObject * | args, | ||
PyObject * | kwds | ||
) | [static] |
static PyObject* array_setflags | ( | PyArrayObject * | self, |
PyObject * | args, | ||
PyObject * | kwds | ||
) | [static] |
References array_astype(), array_byteswap(), array_choose(), array_clip(), array_compress(), array_conjugate(), array_copy(), array_cumprod(), array_cumsum(), array_diagonal(), array_dot(), array_fill(), array_flatten(), array_getfield(), array_max(), array_mean(), array_min(), array_newbyteorder(), array_nonzero(), array_prod(), array_setscalar(), and array_toscalar().
static PyObject* array_setscalar | ( | PyArrayObject * | self, |
PyObject * | args | ||
) | [static] |
Referenced by array_setflags().
static PyObject* array_setstate | ( | PyArrayObject * | self, |
PyObject * | args | ||
) | [static] |
Referenced by array_ravel().
static PyObject* array_sort | ( | PyArrayObject * | self, |
PyObject * | args, | ||
PyObject * | kwds | ||
) | [static] |
static PyObject* array_squeeze | ( | PyArrayObject * | self, |
PyObject * | args, | ||
PyObject * | kwds | ||
) | [static] |
References PyArray_Squeeze().
static PyObject* array_stddev | ( | PyArrayObject * | self, |
PyObject * | args, | ||
PyObject * | kwds | ||
) | [static] |
References NPY_CORDER, and PyArray_OrderConverter().
static PyObject* array_sum | ( | PyArrayObject * | self, |
PyObject * | args, | ||
PyObject * | kwds | ||
) | [static] |
static PyObject* array_swapaxes | ( | PyArrayObject * | self, |
PyObject * | args | ||
) | [static] |
References _PyArray_Descr::elsize, and PyArray_DESCR.
static PyObject* array_take | ( | PyArrayObject * | self, |
PyObject * | args, | ||
PyObject * | kwds | ||
) | [static] |
static PyObject* array_tofile | ( | PyArrayObject * | self, |
PyObject * | args, | ||
PyObject * | kwds | ||
) | [static] |
static PyObject* array_tolist | ( | PyArrayObject * | self, |
PyObject * | args | ||
) | [static] |
static PyObject* array_toscalar | ( | PyArrayObject * | self, |
PyObject * | args | ||
) | [static] |
Referenced by array_setflags().
static PyObject* array_tostring | ( | PyArrayObject * | self, |
PyObject * | args, | ||
PyObject * | kwds | ||
) | [static] |
static PyObject* array_trace | ( | PyArrayObject * | self, |
PyObject * | args, | ||
PyObject * | kwds | ||
) | [static] |
References _IsAligned(), NPY_ARRAY_ALIGNED, PyArray_CLEARFLAGS(), and PyArray_ENABLEFLAGS().
static PyObject* array_transpose | ( | PyArrayObject * | self, |
PyObject * | args | ||
) | [static] |
static PyObject* array_variance | ( | PyArrayObject * | self, |
PyObject * | args, | ||
PyObject * | kwds | ||
) | [static] |
static PyObject* array_view | ( | PyArrayObject * | self, |
PyObject * | args, | ||
PyObject * | kwds | ||
) | [static] |
static PyObject* array_wraparray | ( | PyArrayObject * | self, |
PyObject * | args | ||
) | [static] |
Referenced by array_flatten().
static PyObject* forward_ndarray_method | ( | PyArrayObject * | self, |
PyObject * | args, | ||
PyObject * | kwds, | ||
PyObject * | forwarding_callable | ||
) | [static] |
static PyObject* get_forwarding_ndarray_method | ( | const char * | name | ) | [static] |
NPY_NO_EXPORT const char* npy_casting_to_string | ( | NPY_CASTING | casting | ) |
Referenced by parse_iso_8601_datetime(), and PyUFunc_ValidateCasting().
static int NpyArg_ParseKeywords | ( | PyObject * | keys, |
const char * | format, | ||
char ** | kwlist, | ||
... | |||
) | [static] |
NPY_NO_EXPORT PyObject* PyArray_Byteswap | ( | PyArrayObject * | self, |
npy_bool | inplace | ||
) |
<
NPY_NO_EXPORT int PyArray_Dump | ( | PyObject * | self, |
PyObject * | file, | ||
int | protocol | ||
) |
NPY_NO_EXPORT PyObject* PyArray_Dumps | ( | PyObject * | self, |
int | protocol | ||
) |
NPY_NO_EXPORT PyObject* PyArray_GetField | ( | PyArrayObject * | self, |
PyArray_Descr * | typed, | ||
int | offset | ||
) |
NPY_NO_EXPORT int PyArray_SetField | ( | PyArrayObject * | self, |
PyArray_Descr * | dtype, | ||
int | offset, | ||
PyObject * | val | ||
) |
NPY_NO_EXPORT PyMethodDef array_methods[] |