===========
NumPy C-API
===========
::
unsigned int
PyArray_GetNDArrayCVersion(void )
Included at the very first so not auto-grabbed and thus not labeled.
::
int
PyArray_SetNumericOps(PyObject *dict)
Set internal structure with number functions that all arrays will use
::
PyObject *
PyArray_GetNumericOps(void )
Get dictionary showing number functions that all arrays will use
::
int
PyArray_INCREF(PyArrayObject *mp)
For object arrays, increment all internal references.
::
int
PyArray_XDECREF(PyArrayObject *mp)
Decrement all internal references for object arrays.
(or arrays with object fields)
::
void
PyArray_SetStringFunction(PyObject *op, int repr)
Set the array print function to be a Python function.
::
PyArray_Descr *
PyArray_DescrFromType(int type)
Get the PyArray_Descr structure for a type.
::
PyObject *
PyArray_TypeObjectFromType(int type)
Get a typeobject from a type-number -- can return NULL.
New reference
::
char *
PyArray_Zero(PyArrayObject *arr)
Get pointer to zero of correct type for array.
::
char *
PyArray_One(PyArrayObject *arr)
Get pointer to one of correct type for array
::
PyObject *
PyArray_CastToType(PyArrayObject *arr, PyArray_Descr *dtype, int
is_f_order)
For backward compatibility
Cast an array using typecode structure.
steals reference to dtype --- cannot be NULL
This function always makes a copy of arr, even if the dtype
doesn't change.
::
int
PyArray_CastTo(PyArrayObject *out, PyArrayObject *mp)
Cast to an already created array.
::
int
PyArray_CastAnyTo(PyArrayObject *out, PyArrayObject *mp)
Cast to an already created array. Arrays don't have to be "broadcastable"
Only requirement is they have the same number of elements.
::
int
PyArray_CanCastSafely(int fromtype, int totype)
Check the type coercion rules.
::
npy_bool
PyArray_CanCastTo(PyArray_Descr *from, PyArray_Descr *to)
leaves reference count alone --- cannot be NULL
PyArray_CanCastTypeTo is equivalent to this, but adds a 'casting'
parameter.
::
int
PyArray_ObjectType(PyObject *op, int minimum_type)
Return the typecode of the array a Python object would be converted to
Returns the type number the result should have, or NPY_NOTYPE on error.
::
PyArray_Descr *
PyArray_DescrFromObject(PyObject *op, PyArray_Descr *mintype)
new reference -- accepts NULL for mintype
::
PyArrayObject **
PyArray_ConvertToCommonType(PyObject *op, int *retn)
::
PyArray_Descr *
PyArray_DescrFromScalar(PyObject *sc)
Return descr object from array scalar.
New reference
::
PyArray_Descr *
PyArray_DescrFromTypeObject(PyObject *type)
::
npy_intp
PyArray_Size(PyObject *op)
Compute the size of an array (in number of items)
::
PyObject *
PyArray_Scalar(void *data, PyArray_Descr *descr, PyObject *base)
Get scalar-equivalent to a region of memory described by a descriptor.
::
PyObject *
PyArray_FromScalar(PyObject *scalar, PyArray_Descr *outcode)
Get 0-dim array from scalar
0-dim array from array-scalar object
always contains a copy of the data
unless outcode is NULL, it is of void type and the referrer does
not own it either.
steals reference to outcode
::
void
PyArray_ScalarAsCtype(PyObject *scalar, void *ctypeptr)
Convert to c-type
no error checking is performed -- ctypeptr must be same type as scalar
in case of flexible type, the data is not copied
into ctypeptr which is expected to be a pointer to pointer
::
int
PyArray_CastScalarToCtype(PyObject *scalar, void
*ctypeptr, PyArray_Descr *outcode)
Cast Scalar to c-type
The output buffer must be large-enough to receive the value
Even for flexible types which is different from ScalarAsCtype
where only a reference for flexible types is returned
This may not work right on narrow builds for NumPy unicode scalars.
::
int
PyArray_CastScalarDirect(PyObject *scalar, PyArray_Descr
*indescr, void *ctypeptr, int outtype)
Cast Scalar to c-type
::
PyObject *
PyArray_ScalarFromObject(PyObject *object)
Get an Array Scalar From a Python Object
Returns NULL if unsuccessful but error is only set if another error occurred.
Currently only Numeric-like object supported.
::
PyArray_VectorUnaryFunc *
PyArray_GetCastFunc(PyArray_Descr *descr, int type_num)
Get a cast function to cast from the input descriptor to the
output type_number (must be a registered data-type).
Returns NULL if un-successful.
::
PyObject *
PyArray_FromDims(int nd, int *d, int type)
Construct an empty array from dimensions and typenum
::
PyObject *
PyArray_FromDimsAndDataAndDescr(int nd, int *d, PyArray_Descr
*descr, char *data)
Like FromDimsAndData but uses the Descr structure instead of typecode
as input.
::
PyObject *
PyArray_FromAny(PyObject *op, PyArray_Descr *newtype, int
min_depth, int max_depth, int flags, PyObject
*context)
Does not check for NPY_ARRAY_ENSURECOPY and NPY_ARRAY_NOTSWAPPED in flags
Steals a reference to newtype --- which can be NULL
::
PyObject *
PyArray_EnsureArray(PyObject *op)
This is a quick wrapper around
PyArray_FromAny(op, NULL, 0, 0, NPY_ARRAY_ENSUREARRAY, NULL)
that special cases Arrays and PyArray_Scalars up front
It *steals a reference* to the object
It also guarantees that the result is PyArray_Type
Because it decrefs op if any conversion needs to take place
so it can be used like PyArray_EnsureArray(some_function(...))
::
PyObject *
PyArray_EnsureAnyArray(PyObject *op)
::
PyObject *
PyArray_FromFile(FILE *fp, PyArray_Descr *dtype, npy_intp num, char
*sep)
Given a ``FILE *`` pointer ``fp``, and a ``PyArray_Descr``, return an
array corresponding to the data encoded in that file.
If the dtype is NULL, the default array type is used (double).
If non-null, the reference is stolen and if dtype->subarray is true dtype
will be decrefed even on success.
The number of elements to read is given as ``num``; if it is < 0, then
then as many as possible are read.
If ``sep`` is NULL or empty, then binary data is assumed, else
text data, with ``sep`` as the separator between elements. Whitespace in
the separator matches any length of whitespace in the text, and a match
for whitespace around the separator is added.
For memory-mapped files, use the buffer interface. No more data than
necessary is read by this routine.
::
PyObject *
PyArray_FromString(char *data, npy_intp slen, PyArray_Descr
*dtype, npy_intp num, char *sep)
Given a pointer to a string ``data``, a string length ``slen``, and
a ``PyArray_Descr``, return an array corresponding to the data
encoded in that string.
If the dtype is NULL, the default array type is used (double).
If non-null, the reference is stolen.
If ``slen`` is < 0, then the end of string is used for text data.
It is an error for ``slen`` to be < 0 for binary data (since embedded NULLs
would be the norm).
The number of elements to read is given as ``num``; if it is < 0, then
then as many as possible are read.
If ``sep`` is NULL or empty, then binary data is assumed, else
text data, with ``sep`` as the separator between elements. Whitespace in
the separator matches any length of whitespace in the text, and a match
for whitespace around the separator is added.
::
PyObject *
PyArray_FromBuffer(PyObject *buf, PyArray_Descr *type, npy_intp
count, npy_intp offset)
::
PyObject *
PyArray_FromIter(PyObject *obj, PyArray_Descr *dtype, npy_intp count)
没有合适的资源?快使用搜索试试~ 我知道了~
pandas删除含有特定数值的行或列
共3438个文件
py:1216个
pyc:1120个
pyd:77个
3星 · 超过75%的资源 需积分: 50 187 下载量 185 浏览量
2018-06-20
13:27:25
上传
评论 3
收藏 28.34MB RAR 举报
温馨提示
使用pandas处理数据时,如何实现删除/选取某列含有特殊数值的行或者某行含有特殊数值的列,以及如何去除含有空值的行或列
资源推荐
资源详情
资源评论
收起资源包目录
pandas删除含有特定数值的行或列 (3438个子文件)
Abidjan 170B
Accra 842B
Acre 662B
ACT 2KB
activate 2KB
Adak 2KB
Addis_Ababa 285B
Adelaide 2KB
Aden 187B
Alaska 2KB
Aleutian 2KB
Algiers 760B
Almaty 1KB
Amman 2KB
Amsterdam 3KB
Anadyr 1KB
Anchorage 2KB
Andorra 2KB
Anguilla 170B
Antananarivo 285B
Antigua 170B
Apia 1KB
Aqtau 1017B
Aqtobe 1KB
Araguaina 910B
Arizona 353B
Aruba 212B
Ashgabat 651B
Ashkhabad 651B
Asmara 285B
Asmera 285B
Astrakhan 1KB
Asuncion 2KB
Athens 2KB
Atikokan 345B
Atka 2KB
Atlantic 3KB
Atyrau 1KB
Auckland 2KB
Azores 3KB
Baghdad 1004B
Bahia 1KB
Bahia_Banderas 2KB
Bahrain 225B
BajaNorte 2KB
BajaSur 2KB
Baku 1KB
Bamako 170B
Bangkok 220B
Bangui 171B
Banjul 170B
Barbados 344B
Barnaul 1KB
activate.bat 635B
deactivate.bat 368B
Beirut 2KB
Belem 602B
Belfast 4KB
Belgrade 2KB
Belize 978B
Berlin 2KB
Bermuda 2KB
Beulah 2KB
Bishkek 1KB
Bissau 208B
Blanc-Sablon 307B
Blantyre 171B
Boa_Vista 658B
Bogota 271B
Boise 2KB
Bougainville 296B
Bratislava 2KB
Brazzaville 171B
Brisbane 452B
Broken_Hill 2KB
Brunei 229B
Brussels 3KB
Bucharest 2KB
Budapest 2KB
Buenos_Aires 1KB
Buenos_Aires 1KB
Bujumbura 171B
Busingen 2KB
tips.csv.bz2 1KB
test1.csv.bz2 307B
salaries.csv.bz2 283B
fortranobject.c 35KB
wrapmodule.c 9KB
gfortran_vs2003_hack.c 74B
Cairo 2KB
Calcutta 312B
Cambridge_Bay 2KB
Campo_Grande 2KB
Canary 2KB
Canberra 2KB
Cancun 816B
Cape_Verde 284B
Caracas 289B
Casablanca 2KB
Casey 311B
共 3438 条
- 1
- 2
- 3
- 4
- 5
- 6
- 35
资源评论
- wl2020mxxb2021-07-20不能直接处理导入的csv表,没啥用
- weixin_398418482020-04-22很好很不错的,谢谢分享学习
luocheng7430
- 粉丝: 31
- 资源: 1
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功