취소
다음에 대한 결과 표시 
다음에 대한 검색 
다음을 의미합니까? 

Array size

해결 완료!
솔루션으로 이동

For example, I have 3 1d array with with different size.  I combined them and make them into a 2d array.  When I index the shortest original 1d array out of the 2d aray, the size is now equal to the rest of the original 1d arrays.  Is there an easy way to preserve the dimension?  i don't want to padding.  thanks.

------------------------------------------------------------------

Kudos and Accepted as Solution are welcome!
0 포인트
1/6 메시지
4,501 조회수

In a 2D array, all rows or colums need to be the same lenght.

 

You can bundle each 1D array and make them into a 1D array of clusters, each containing a 1D array of variable lenght.

 

 

 

(Here's an example using "build cluster array").

 

You could also encode the lenght of each row prepended as the first element.

2/6 메시지
4,496 조회수

there is a feature request for ragged arrays

_____________________________
- Cheers, Ed
3/6 메시지
4,492 조회수

It is hard to do that bundle, since each of the 1d array is genearated in a for loop.  is there an easy way to build a cluster of arrays in a loop? 

------------------------------------------------------------------

Kudos and Accepted as Solution are welcome!
0 포인트
4/6 메시지
4,480 조회수
솔루션
주제 작성자 jyang72211이(가) 승인함

Why is this hard? Simply insert a bundle function of height=1 before autoindexing at the right loop boundary.

 

 

5/6 메시지
4,473 조회수

You are right.  Thanks for clarifying.  An array of cluster array.  I see.

------------------------------------------------------------------

Kudos and Accepted as Solution are welcome!
0 포인트
6/6 메시지
4,457 조회수