Answers for "tuple to numpy array python"

0

convert tuple to array python

import numpy 

my_tuple = ([8, 4, 6], [1, 2, 3])
print("Tuple to array: ")
print(numpy.asarray(my_tuple))
Posted by: Guest on January-27-2021
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