Skip to content
Advertisement

reshape the array with specific form

I have an specific array which each rows has to array. I want to reshape it. But, I don’t know how to reshape it to a 2d array. Here is my array:

JavaScript

Here is the desired output:

JavaScript

Any help appreciated.

Thanks

I’ve tried to use the reshape. But, it does not solve.

Advertisement

Answer

It’s ragged, it’s not concatenated. Is it a question of flattening the array to a list of arrays?

JavaScript

Output:

JavaScript
User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement