I have seen a bug in the section Cross Validation: For Selecting Polynomial Model Degree of Lecture_6_Notebook.ipynb. The degree d is incorrectly used in the PolynomialFeatures constructor. This has a value of 19 which is the last index of the previous loop. The intention is to use the degree with the best cross-validation score so the code should read:
gen_poly_terms = PolynomialFeatures(degree=best_degree, interaction_only=False)
PS: Likewise, I have not submitted a pull request for this as you may not want the output produced from my notebook.