NumSharp icon indicating copy to clipboard operation
NumSharp copied to clipboard

np.roll - Index was outside the bounds of the array

Open ChengYen-Tang opened this issue 5 years ago • 2 comments

I get the following message when using np.roll. Index was outside the bounds of the array

var a = np.arange(10);
a.roll(5, 1);
Console.WriteLine(a.ToString());

ChengYen-Tang avatar Nov 13 '20 18:11 ChengYen-Tang

Isn't the first axis numbered as 0, i.e., a.roll(5, 0)?

But in despite of this, I get the same exception with an array of shape (100, 400, 9): a = a[":", ":", 0].roll(1, 0) I tried different parameters. I always get an exception. I also don't find a unit test for roll.

OJacot-Descombes avatar Feb 03 '21 14:02 OJacot-Descombes

@OJacot-Descombes ,

Ignore 😥 https://github.com/SciSharp/NumSharp/blob/00d8700b00e815f321238536e0d6b4dbc9af8d6a/test/NumSharp.UnitTest/Creation/NdArray.Roll.Test.cs

ChengYen-Tang avatar Feb 03 '21 16:02 ChengYen-Tang

@OJacot-Descombes I found a more complete package, maybe you can try it. https://github.com/Quansight-Labs/numpy.net

ChengYen-Tang avatar Sep 09 '22 18:09 ChengYen-Tang