What do you think of adding a ticks parameter to DataArray? Would that
make sense?

Current behavior:

>> x = DataArray([[1, 2], [3, 4]], (('row', ['A','B']), ('col', ['C', 'D'])))
>> x.axes
(Axis(label='row', index=0, ticks=['A', 'B']),
 Axis(label='col', index=1, ticks=['C', 'D']))

Proposed ticks as separate input parameter:

>> x = DataArray([[1, 2], [3, 4]], labels=('row', 'col'), ticks=[['A', 'B'], 
>> ['C', 'D']])

I think this would make it easier for new users to construct a
DataArray with ticks just from looking at the function signature. It
would match the function signature of Axis. My use case is to use
ticks only and not names axes (at first), so:

>> x = DataArray([[1, 2], [3, 4]], labels=None, ticks=[['A', 'B'], ['C', 'D']])

instead of the current:

>> x = DataArray([[1, 2], [3, 4]], ((None, ['A','B']), (None, ['C', 'D'])))

It might also cause less typos (parentheses matching) at the command line.

I've only made a few DataArrays so I don't understanding the
ramifications of what I am suggesting.
_______________________________________________
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion

Reply via email to