8.5.38. Array¶
- class Array[source]¶
Methods
alla.all(axis=None, out=None, keepdims=False, *, where=True)
anya.any(axis=None, out=None, keepdims=False, *, where=True)
argmaxa.argmax(axis=None, out=None, *, keepdims=False)
argmina.argmin(axis=None, out=None, *, keepdims=False)
argpartitiona.argpartition(kth, axis=-1, kind='introselect', order=None)
argsorta.argsort(axis=-1, kind=None, order=None)
astypea.astype(dtype, order='K', casting='unsafe', subok=True, copy=True)
byteswapa.byteswap(inplace=False)
choosea.choose(choices, out=None, mode='raise')
clipa.clip(min=None, max=None, out=None, **kwargs)
collapsecompressa.compress(condition, axis=None, out=None)
conja.conj()
conjugatea.conjugate()
copya.copy(order='C')
cumproda.cumprod(axis=None, dtype=None, out=None)
cumsuma.cumsum(axis=None, dtype=None, out=None)
diagonala.diagonal(offset=0, axis1=0, axis2=1)
dotdumpa.dump(file)
dumpsa.dumps()
filla.fill(value)
flattena.flatten(order='C')
getfielda.getfield(dtype, offset=0)
itema.item(*args)
maxa.max(axis=None, out=None, keepdims=False, initial=<no value>, where=True)
meana.mean(axis=None, dtype=None, out=None, keepdims=False, *, where=True)
mina.min(axis=None, out=None, keepdims=False, initial=<no value>, where=True)
nonzeroa.nonzero()
partitiona.partition(kth, axis=-1, kind='introselect', order=None)
proda.prod(axis=None, dtype=None, out=None, keepdims=False,
puta.put(indices, values, mode='raise')
ravela.ravel([order])
repeata.repeat(repeats, axis=None)
a.reshape(shape, /, *, order='C', copy=None)
resizea.resize(new_shape, refcheck=True)
rounda.round(decimals=0, out=None)
searchsorteda.searchsorted(v, side='left', sorter=None)
setfielda.setfield(val, dtype, offset=0)
setflagsa.setflags(write=None, align=None, uic=None)
sorta.sort(axis=-1, kind=None, order=None)
squeezea.squeeze(axis=None)
stda.std(axis=None, dtype=None, out=None, ddof=0, keepdims=False, *, where=True)
suma.sum(axis=None, dtype=None, out=None, keepdims=False, initial=0, where=True)
swapaxesa.swapaxes(axis1, axis2)
takea.take(indices, axis=None, out=None, mode='raise')
to_devicetobytesa.tobytes(order='C')
tofilea.tofile(fid, sep="", format="%s")
tolista.tolist()
tracea.trace(offset=0, axis1=0, axis2=1, dtype=None, out=None)
transposea.transpose(*axes)
vara.var(axis=None, dtype=None, out=None, ddof=0, keepdims=False, *, where=True)
viewa.view([dtype][, type])
- __init__()¶
Attributes
TView of the transposed array.
baseBase object if memory is from some other object.
ctypesAn object to simplify the interaction of the array with the ctypes module.
dataPython buffer object pointing to the start of the array's data.
devicedtypeData-type of the array's elements.
flagsInformation about the memory layout of the array.
flatA 1-D iterator over the array.
imagThe imaginary part of the array.
itemsetitemsizeLength of one array element in bytes.
mTView of the matrix transposed array.
nbytesTotal bytes consumed by the elements of the array.
ndimNumber of array dimensions.
newbyteorderptprealThe real part of the array.
shapeTuple of array dimensions.
sizeNumber of elements in the array.
stridesTuple of bytes to step in each dimension when traversing an array.
- reshape(shape, /, *, order='C', copy=None)[source]¶
Returns an array containing the same data with a new shape.
Refer to numpy.reshape for full documentation.
8.5.38. See Also¶
numpy.reshape : equivalent function
8.5.38. Notes¶
Unlike the free function numpy.reshape, this method on ndarray allows the elements of the shape parameter to be passed in as separate arguments. For example,
a.reshape(10, 11)is equivalent toa.reshape((10, 11)).