Methods

Methods:

>>> a = np.random.randn(3,4)
>>> filter(lambda x: type(getattr(a,x))==type(a.min), dir(a))

Sorting

sort() and argsort()

These methods default to sorting the flattened array (returning an ndarray). If given an axis keyword, then it is possible to preserve the axes meta-data only if there are no ticks on the sorted Axis. Otherwise, an ndarray is returned.

Explicitly overloaded

These methods do not fit into a simple pattern, and are explicitly overloaded in the DataArray class definition.

Regular reductions (eg, min)

These methods are wrapped in a generic runner that pays attention to which axis is being trimmed out (if only one), and then sets the remaining axes on the resulting array. It also allows for the translation of Axis-name to Axis-index.

Special reductions (eg, argmin)

These methods are currently wrapped as a generic reduction.

These methods return an index, or an array of indices into the array in question. That significantly changes the model of the array in question. Should the return type here NOT be DataArray?

Accumulations

These methods are wrapped in a generic accumulator.

These methods have the property of taking an “axis” keyword argument, and yet not eliminating that axis. They also default to working on the flattened array if the axis parameter is left unspecified.

Not-applicable methods

Possibly N/A methods?

Reshapes

Reshaping is prickly.. I’ve already implemented certain slicing mechanisms that can insert unlabeled axes with length-1. This seems legitimate. Also squeezing out length-1 seems legitimate (even if the Axis is labeled?).

The reshaping currently only trims or pads the array shape with 1s, or flattens the array entirely (returning an ndarray).

Table Of Contents

Previous topic

DataArrays

Next topic

License

This Page