I am learning Python for trading.
Code as per solution in unit 7, section 11
df['fastk'], df['fastd'] = ta.STOCHF(
df.High.values, df.Low.values, df.Close.values, fastk_period=5, fastd_period=3)
Code as put in Jupyter notebook (Unit 5, section 11)
stock_data['fastk'], stock_data['fastd'] = ta.STOCHF(stock_data['High'].values, stock_data['Low'].values, stock_data['Close'].values, fastk_period=5, fastd_period=3)
Except for the change in name of the dataframe, rest is same. I have got a pink error message with a query though the output has come “Have you passed the correct parameters to the STOCHF fucntion. Refer to the instructions. “
Will someone please clarify to me whether any fundamental difference exists in the code as given in solution and as put by me copied from the Jupyter notebook
Hi Mr. Ramamurthy,
Thanks for pointing out the inconsistency. We have updated the IE to be consistent with the notebook and used df['column'] in both places.
df['column'] and df.column refers to the column of the dataframe. There is no difference between these two, and the output should be the same.
Please try passing
df['fastk'], df['fastd'] = ta.STOCHF(df['High'].values, df['Low'].values, df['Close'].values, fastk_period=5, fastd_period=3)
Since the IE has been updated, you will no longer get the error message.
Thank you