A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://docs.astropy.org/en/stable/api/../api/astropy.utils.shapes.ShapedLikeNDArray.html below:

ShapedLikeNDArray — Astropy v7.1.0

ShapedLikeNDArray#
class astropy.utils.shapes.ShapedLikeNDArray[source]#

Bases: NDArrayShapeMethods

Mixin class to provide shape-changing methods.

The class proper is assumed to have some underlying data, which are arrays or array-like structures. It must define a shape property, which gives the shape of those data, as well as an _apply method that creates a new instance in which a ndarray method has been applied to those.

Furthermore, for consistency with ndarray, it is recommended to define a setter for the shape property, which, like the shape property allows in-place reshaping the internal data (and, unlike the reshape method raises an exception if this is not possible).

This class also defines default implementations for ndim and size properties, calculating those from the shape. These can be overridden by subclasses if there are faster ways to obtain those numbers.

Attributes Summary

Attributes Documentation

isscalar#
ndim#

The number of dimensions of the instance and underlying arrays.

shape#

The shape of the underlying data.

size#

The size of the object, as calculated from its shape.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4