hulkingtickets - 10 months ago 68

Python Question

How do I convert a NumPy array to a Python List (for example

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

Answer Source

Use `tolist()`

:

```
import numpy as np
>>> np.array([[1,2,3],[4,5,6]]).tolist()
[[1, 2, 3], [4, 5, 6]]
```