Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upNdarray with column-major ordering cuts across array-of-arrays input #268
Comments
|
@rreusser Thanks for filing this issue. Will look into producing a fix shortly. |
|
@rreusser Okay, so the current behavior is intentional. As documented in the package documentation, when you specify an It is not clear, at least in my mind, what a user means when s/he provides a nested array and then declares that the data "order" is column-major, at least in the "descriptive" sense, as the inferred shape based on the provided argument is at odds with, as you show in your examples, the shape as might be expected for data provided as column-major. Maybe it makes more sense to throw an error here, instead of trying to guess what a user intends? |
|
Based on Gitter discussion, consensus seems to be that the README documentation should include an example explicitly showing how order specification is descriptive, not prescriptive, and highlight potential "gotchas", such as specifying "column-major" does not mean that a provided nested array should be flattened to column-major order, but rather that the data is provided in column-major order already. |


Checklist
Description
The following code produces an array whose shape does not match what I'd expect:
As a matrix, it looks like:
The resulting matrix seems to cut across the array-of-arrays input. If you simply interpret this as a
2 x 3array instead of3 x 2, then it matches what I'd expect. I suspect but haven't confirmed that reversing the order of the inferred shape may solve the issue (for 2D and higher dimensionalities). See example and demonstration that reversing may fix hereRelated Issues
No.
Questions
No.
Other
Demo
For a live demo of the issue, see
Reproduction
See above for code.
Expected Results
I expect the inner arrays of array-of-arrays input to show up in the constructed array as either a row or a column, not to be split and spread across multiple columns.
Actual Results
shapeseems reversed in a manner that spreads inner arrays across multiple columns.Environments
The following environments are affected: