I think this is actually a simple question for comp. sci. people, but I am not in a comp. sci. program and can't remember any terminology.
I have made a large set of functions which are essentially nested to create a large numpy record array.
data = func_to_make_large_structure()
Now, when I assign data
like this, does it store the large structure as it is after the function returns, or does the function get called and re-calculate every time it is called?
It is taking 30 seconds to make the structure, which is considerably longer than it takes for a similar structure to be created in OO by using an object to store the data.
In addition, I then do a large amount of processing on the data which takes much longer for the functional program than the OO form.
Is this because the data is being recalculated every time the data
is called?
If so, how do I store just the data without calling the function everytime?