napari_bigfish.array_util module

class napari_bigfish.array_util.ArrayUtil[source]

Bases: object

A class to provide utils that do common operations on arrays.

static stripZeroRowsAndColumns(data, zero=0)[source]

Return an array with all-zero rows and columns removed.

Returns a stripped array, with all rows and columns, in which each element is zero, removed. Instead of rows and comumns with all zero elements, rows and columns containing another number, string or object at each position can be removed from the array.

Parameters
  • data (numpy.ndarray) – A table from which empty rows and columns will be stripped

  • zero – The element for which rows and columns will be removed

Returns

A 3-tupel with

  • the input array data with all-zero rows and columns removed

  • A 1D array of the indices of the columns that are not all zero in the input array

  • A 1D array of the indices of the rows that are not all zero in the input array

Return type

(numpy.ndarray, numpy.ndarray, numpy.ndarray)