Possibly wrong terminologies here, please correct me.
Problem:
I have many objects, say lists of integers a=[1,3,7], b=[1,9], c... etc. I want to convert each to an np.array for instance.
So far:
What works: Explicitly convert individually:
a=np.array(a)
b=np.array(b)
...
What did not work:
[np.array(x) for x in [a,b,c...]]
which only gives a list of the arrays (ok, that was expected) but does not change the variable a,b... to be of type np.array.
I am aware this unveils how little I know about python basics (what is pointer, what is reference etc...too long ago where I learned about it for c++).
a,b,c = [np.array(x) for x in [a,b,c...]][np.array(x) for x in [a,b,c]](but i second chepners comment)dictwhose keys you can iterate over in order to reassign to the same keys.for k, v in d.items(): d[k] = np.array(v)..__class__of an object, but that won't work between lists and arrays.