Skip to content

Indexing gives view of data but copy of axis #6

Description

@kwgoodman

Non-fancy indexing of a numpy array returns a view. A view of the data of a datarray is returned:

>> x = DataArray([[1,2],[3,4]], [('row', ['r1', 'r2']), ('col', ['c1', 'c2'])])
>> y = x[0]

>> y[0] = 9
>> x[0,0]
   9

But a copy of the axes is returned:

>> y.axes[0].ticks[0] = 'X'
>> x.axes[0].ticks[0]
   'r1'

Is that what we want?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions