👌

【VisibleDeprecationWarning】Why is it deprecated to generate ndarray ob

2022/04/05に公開
[
  [1,4],
  [1,2],
  [5,6]
]

If you are trying to create an array of arrays that are dimensionally aligned (in both of the above examples, one dimension is two elements), such as
You can make a clean two-dimensional array, so it can be put into ndarray straightforwardly.

[
  [1],
  [1,2], 
  ['one']
]
[
  [1],  // No second element in the first dimension!
  [1,2], 
  ['one'] // No second element in the first dimension!
]

It does not become an array with data as neatly as ndarray.

There are cases where it is necessary to use nested arrays with a jug array that allows for a non-uniform number of inner elements, but I think that is deprecated in the sense that it is not appropriate for ndarrays.

Discussion