Skip to content

BUG: numpy.pad with mode='wrap' give unexpected return #22464

@patrick-csliu

Description

@patrick-csliu

Relative to the question in stackoverflow, I think wrap should pad the array by itself repeat and repeat, but np.pad(array, pad_width, mode='wrap') seems not doing so.

The example I have already posted in stack overflow. I am not sure if this is a bug or implemented this way for reason?
In some conditions, np.pad(mode='wrap) returned something stange, usually it happens at left_pad or right_pad greater than the input array along the axis, especially, when left_pad or right_pad is not integral multiple of array length along the axis.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions