Kotlin / kotlin-numpy

Kotlin bindings for NumPy
Apache License 2.0
316 stars 11 forks source link

how to convert List or Array to KtNDArray #20

Closed pengyuan-zhou closed 4 years ago

pengyuan-zhou commented 4 years ago

Hi,

How to convert normal Kotlin List or Array to KtNDArray and vice-versa ?

Thanks.

devcrocod commented 4 years ago

Hi,

To create an KtNDArray from an array or from a list, you can use the array method. To vice versa from KtNDArray to list there are methods toList, toList2d, toList3d.

Hope I helped you.

pengyuan-zhou commented 4 years ago

Hi,

To create an KtNDArray from an array or from a list, you can use the array method. To vice versa from KtNDArray to list there are methods toList, toList2d, toList3d.

Hope I helped you.

It worked, thank you !