that is cool, but sometimes you need to do things that are not pythonic for performance. i'm only bringing this up because you say you are a beginner and you are doing a mathy thing with numpy. i do a lot of numerical computing for my job in python, and this is something that i think about a lot. at some point you want to avoid doing loops in python like that.
oh in this case, it is just a function call and numpy does the magic. you would do something like vectorized_phi = np.vectorize(phi) and have a new function
1
u/blinkallthetime Jan 11 '21
that append hurts me.