Skip to content

Array.insert on anonymous axis fails #878

Open
@gdementen

Description

@gdementen

When the axis has a name, no problem:

>>> arr = ndtest(3)
>>> arr.insert(-1, before='0[a1]', label='before_a1')
a  a0  before_a1  a1  a2
    0         -1   1   2
>>> arr.insert(-1, before=arr.axes[0]['a1'], label='before_a1')
a  a0  before_a1  a1  a2
    0         -1   1   2

But it fails if the axis is anonymous:

>>> arr = ndtest("a0..a2")
>>> arr.insert(-1, before='0[a1]', label='before_a1')
KeyError: "axis '{?}' not found in {{0}}"
>>> arr.insert(-1, before=arr.axes[0]['a1'], label='before_a1')
KeyError: "axis '{?}' not found in {{0}}"

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions