practical-machine-learning-with-python icon indicating copy to clipboard operation
practical-machine-learning-with-python copied to clipboard

Bug-Fix Issue-#29

Open Gopi-Vamsi-Penaganti opened this issue 2 years ago • 1 comments

#29 Issue

Errors:

  1. AttributeError: 'Series' object has no attribute 'ix'
  2. TypeError: Addition/subtraction of integers and integer-arrays with Timestamp is no longer supported. Instead of adding/subtracting n, use n * obj.freq

Changes made in : File Location

Changes made:

  1. Replaced .ix with .iloc (as per pandas updated version)

Line-163

plt.plot((np.exp(train_series.ix[1:].tolist())-\
                             np.exp(insample_fit)))

Line 119 & 120:

train_series = series.ix[train_index]
test_series = series.ix[test_index]
  1. Line-160 to 162:

Changed From:

insample_fit = list(results.predict(train_series.index.min()+1, 
                                                train_series.index.max(),
                                                typ='levels')) 

To

insample_fit = list(results.predict(train_series.index.min() + 1*train_series.index.freq, 
                                                train_series.index.max(),
                                                typ='levels')) 

Gopi-Vamsi-Penaganti avatar Mar 25 '23 21:03 Gopi-Vamsi-Penaganti

I'm a little late to the party, but I noticed you all aren't using a notebook review tool and wanted to invite you to review this pull request with GitNotebooks: https://gitnotebooks.com/dipanjanS/practical-machine-learning-with-python/pull/37

It lets you do things like comment on rendered markdown and code cells, so might be an easy win for your PR reviews.

smith-kyle avatar Jan 31 '24 22:01 smith-kyle