dipanjanS/practical-machine-learning-with-python

Chapter 11 - notebook_gold_forecast_arima.ipynb

Maghnia opened this issue · 0 comments

Hello,
I hope you're well.
I like very much your handbook and real-world examples.
My issue is the following concerning the Chapter 11 - notebook_gold_forecast_arima.ipynb : in the paragraph 24th of "ARIMA/Training-Testing Split" : there is a problem of "AttributeError: 'Series' object has no attribute 'ix':

In : results_dict = arima_gridsearch_cv(new_df.log_series,cv_splits=5)

Out :
`********************
Iteration 1 of 5
TRAIN: [ 0 1 2 ... 2922 2923 2924] TEST: [2925 2926 2927 ... 5847 5848 5849]

AttributeError Traceback (most recent call last)
in
----> 1 results_dict = arima_gridsearch_cv(new_df.log_series,cv_splits=5)

~\anaconda3\workdoc\handbook\practical-machine-learning-with-python-master\notebooks\Ch11_Forecasting_Stock_and_Commodity_Prices\arima_utils.py in arima_gridsearch_cv(series, cv_splits, verbose, show_plots)
117
118 # split train and test sets
--> 119 train_series = series.iloc[train_index]
120 test_series = series.iloc[test_index]
121

~\anaconda3\lib\site-packages\pandas\core\generic.py in getattr(self, name)
5137 if self._info_axis._can_hold_identifiers_and_holds_name(name):
5138 return self[name]
-> 5139 return object.getattribute(self, name)
5140
5141 def setattr(self, name: str, value) -> None:

AttributeError: 'Series' object has no attribute 'ix'`

Actually, the attribute 'ix' is deprecated since latest Python versions. So, I replaced 'ix' with 'iloc' in the arima_utils.py file (function : arima_gridsearch_cv), but it has another problem. So, I am upset, I have no clue to fix the problem. Could you please send us the updated files related to the chapter 11 ? I thank you in advance.

Best Regards,

Maghnia Dib