Answers for "tuple to array numpy"

2

numpy array from list

>>> a = [1, 2]
>>> np.asarray(a)
array([1, 2])
Posted by: Guest on September-21-2020
0

numpy array into tuple

def totuple(a):
    try:
        return tuple(totuple(i) for i in a)
    except TypeError:
        return a
Posted by: Guest on August-06-2021

Python Answers by Framework

Browse Popular Code Answers by Language