Answers for "from tuple to np array"

1

np to tuple

tuple(arr)
Posted by: Guest on March-10-2021
0

np array to tuple

>>> arr = numpy.array(((2,2),(2,-2)))
>>> tuple(map(tuple, arr))
((2, 2), (2, -2))
Posted by: Guest on September-22-2020

Python Answers by Framework

Browse Popular Code Answers by Language