larray.LArray.labelofmax

LArray.labelofmax(axis=None)[source]

Returns labels of the maximum values along a given axis.

Parameters:

axis : int or str or Axis, optional

Axis along which to work. If not specified, works on the full array.

Returns:

LArray

Notes

In case of multiple occurrences of the maximum values, the labels corresponding to the first occurrence are returned.

Examples

>>> nat = Axis('nat=BE,FR,IT')
>>> sex = Axis('sex=M,F')
>>> arr = LArray([[0, 1], [3, 2], [2, 5]], [nat, sex])
>>> arr
nat\sex  M  F
     BE  0  1
     FR  3  2
     IT  2  5
>>> arr.labelofmax(X.sex)
nat  BE  FR  IT
      F   M   F
>>> arr.labelofmax()
('IT', 'F')