Use matplotlib to draw scatter plot and report error ValueError: x and y must be the same size.

follow a kaggle project ( https://www.kaggle.com/roshan.). There is an error when making the last picture, the code is the same as the author"s, and the cause of the problem can not be found.
has confirmed that range (len (X_test) is the same length as predictions-prediction_log, and the type of predictions-predictions_log is numpy.ndarray

plt.scatter (range (len (X_test)), predictions-prediction_log, color = "red", alpha = 0.5)
plt.xlabel (" count of test data")
plt.ylabel ("difference of prediction with and without log")
plt.show ()

Jul.23,2021

range (len (X_test)) is not numpy.ndarray
I guess it may be relevant?

Menu