Here is the way I try to calculate the time for CPU in Window.
start_time_1 = time.clock()
coupl.setParareal(pr)
pr.initialize(y1d_init)
pr.iterate()
y1d_pr = pr.state_mic
end_time_1 = time.clock()
Can someone help me to get rid of this error?
Probably you created a numpy array named time
somewhere before this code snippet. You should not do that, because the module time
now gets overwritten. Rename your array (to something like time_list
), and it works.
I have similar question like this. The error occurs as below
'numpy.ndarray' object has no attribute 'asctime'
That means you have created an array named 'time', so in order to avoid the conficts between Keywords and Variables etc.We have to identify every variable's name and be cautious when import xx as xx
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With