Error in Python script “Expected 2D array, got 1D array instead:”?

后端 未结 9 739
执念已碎
执念已碎 2020-11-30 01:29

I\'m following this tutorial to make this ML prediction:

import numpy as np
import matplotlib.pyplot as plt
from matplotlib import style

style.use(\"ggplot\         


        
9条回答
  •  抹茶落季
    2020-11-30 02:11

    I was facing the same issue earlier but I have somehow found the solution, You can try reg.predict([[3300]]).

    The API used to allow scalar value but now you need to give a 2D array.

提交回复
热议问题