jjjkkkjjj / Matft

Numpy-like library in swift. (Multi-dimensional Array, ndarray, matrix and vector library)
BSD 3-Clause "New" or "Revised" License
134 stars 21 forks source link

Multidimensional MfArray with different length Arrays in axis 1 #35

Closed sthuettr closed 2 years ago

sthuettr commented 2 years ago

Hello, I need to write a lot of python (numpy) code in swift and there I found your library. It would be a great help. Is it possible to create MfArrays that have different lengths at axis=1. Here is an example of what I mean:

[
    [1, 2, 3, 4],
    [1, 2, 3],
    [1, 2, 3, 4, 5]
]

If so, how would I need to instantiate the array?

jjjkkkjjj commented 2 years ago

@sthuettr Sorry for late response. Unfortunately Matft doesn’t support object type, so you can’t operate what you showed the unbalanced array in Matft.

How operated array do you want? = how do you operate the below array in Matft?

[
    [1, 2, 3, 4],
    [1, 2, 3],
    [1, 2, 3, 4, 5]
]
sthuettr commented 2 years ago

Ah ok I understand. Then I will just pad the arrays up to the same size