When I am using the code:
delta = df['Close'].diff
dUP, dDown = delta.copy(), delta.copy()
it is giving the error
'function' object has no attribute 'copy' What is the solution?
When I am using the code:
delta = df['Close'].diff
dUP, dDown = delta.copy(), delta.copy()
it is giving the error
'function' object has no attribute 'copy' What is the solution?
Hello Ashish,
You need to use:
delta = df['Close'].diff()
instead of:
delta = df['Close'].diff
As diff() makes sure the function is called and the calculated dataframe/series is returned. While diff is just a reference to the diff function object.
Thanks