You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
A negative axis argument like -1 is often used in Python to specify the innermost axis for a multidimensional array. This is how numpy behaves.
The most common use case is when we want to do some operation on just the last axis of a 2D array like:
Expected behavior axis=-1 and axis=1 should behave the same for a 2D array to get the same behavior as numpy.
Error Message
ValueError: Failed to squeeze array: Unable to squeeze array with shape (10, 1) along axes -1 into a 1D array
Is this a Blocking Issue
Not blocking
Are there any known work-arounds? yes
If a known work around exists, please provide a code block demonstrating it.
You can just do a.ndim+axis when axis < 0 to fix this
This means this is a very easy fix, just that there are a lot of places to fix, and that's if we want to make this change at all.
Additional Context
This issue assumes that this behavior is a bug.
It can be reasonably stated that since Chapel doesn't support negative indexing like Python, we just choose not to support this and the user can fix this where the want using the workaround above.
But on the other hand, this brings Arkouda closer to being a drop in replacement for numpy.
The text was updated successfully, but these errors were encountered:
Describe the bug
A negative
axis
argument like-1
is often used in Python to specify the innermost axis for a multidimensional array. This is how numpy behaves.The most common use case is when we want to do some operation on just the last axis of a 2D array like:
To Reproduce
We get the error:
Expected behavior
axis=-1
andaxis=1
should behave the same for a 2D array to get the same behavior as numpy.Error Message
Is this a Blocking Issue
Not blocking
Are there any known work-arounds? yes
If a known work around exists, please provide a code block demonstrating it.
a.ndim+axis
whenaxis < 0
to fix thisAdditional Context
This issue assumes that this behavior is a bug.
It can be reasonably stated that since Chapel doesn't support negative indexing like Python, we just choose not to support this and the user can fix this where the want using the workaround above.
But on the other hand, this brings Arkouda closer to being a drop in replacement for numpy.
The text was updated successfully, but these errors were encountered: