I'm following along the same book, and encountered the same issue. As it looks like now "acorr_ljungbox" returns a dataframe instead of multiple individual values, I replaced the last two lines with:
lb_dataframe = acorr_ljungbox(residuals, np.arange(1, 11, 1))
lb_dataframe