Sea Level Predictor wrong shape of y data

Hi everyone,

My code fails with the following message:

Arrays are not almost equal to 7 decimals
Expected different line for first line of best fit.
(shapes (2,), (171,) mismatch)
 x: array([0, 1])
 y: array([-0.542124 , -0.4790794, -0.4160349, -0.3529903, -0.2899457,
       -0.2269011, -0.1638565, -0.1008119, -0.0377674,  0.0252772,
        0.0883218,  0.1513664,  0.214411 ,  0.2774556,  0.3405002,...

I found out that[1].get_ydata().tolist() returns a list of [0, 1]

Does anybody have an idea, why this function returns only these values and not the whole set of values?

Please, find my code as follows:

You told it to return just that when you used axline(), since it just draws the line indicated (and only needs two points…). plot() will calculate points over a range (like the test is expecting) and draw the curve with optional markers.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.