i have code:
i restated problem formulation somewhat. not sure if etiquette post new question. if so, bad
import numpy np = np.array([0,0]) b = np.array([1,0]) c = np.array([2,0]) my_array_list = [a,b,c] my_array in my_array_list: np.save('string_that representative of my_array',my_array)
where 'string representative of array' equals 'a', 'b', 'c' or similar.
there better way solve this, can not come 1 right now.
what best way this, fast , efficiently?
i can suggest function:
import numpy np def namestr(obj, namespace): return [name name in namespace if namespace[name] obj] my_numpy = np.zeros(2) print(namestr(my_numpy, globals()))
with output:
['my_numpy']
Comments
Post a Comment