This repository was archived by the owner on Jun 21, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 39
Array methods
Jim Pivarski edited this page Oct 1, 2018
·
10 revisions
All arrays (should) have the following methods:
- constructor via the direct and most complete internal representation
- classmethod constructors from different sets of information
fromiter
-
copy,deepcopywith the same overloads as the constructor -
empty_like,zeros_like,ones_likewith overrides passed tocopy - read/write properties for all representations
-
typefor the awkward Type -
__len__,shapefor the Numpy shape -
dtypefor the nearest Numpy approximation (used by__array__when that's enabled) -
basefor resolving views -
_validfor any checks before an access -
_argfieldsfor checking arguments in a higher-order function -
__iter__for iteration (optimization over__getitem__) -
__getitem__- string-slice pass-through to Table
- empty tuple returns self
- non-tuples promoted to tuples, with
head... - integer index returns an item
- slice returns an array of the same type
- mask array returns an array of the same type
- index array returns an array of the same type
- with
tailpassed through
-
__setitem__pass-through to Table -
__array_ufunc__handles Numpy ufuncs -
any,all,count_nonzero,sum,prod,min,maxreduce -
argmin,argmaxpseudo-reduce -
concat(classmethod) concatenates -
zip(classmethod) builds a Table -
columns,allcolumnspass-through to Table -
pandasmakes a DataFrame