Quando vou plotar os dados com a biblioteca Matplotlib e executo o bloco de comandos:
import matplotlib.pyplot as plt
plt.contourf(xx, yy, Z, alpha=0.3)
plt.scatter(teste_x.horas_esperadas, teste_x.preco, c=teste_y, s=1)
Recebo esta saída:
TypeError Traceback (most recent call last)
<ipython-input-15-5e679b570130> in <module>()
1 import matplotlib.pyplot as plt
----> 2 plt.contourf(xx, yy, Z, alpha=0.3)
3 plt.scatter(teste_x.horas_esperadas, teste_x.preco, c=teste_y, s=1)
6 frames
/usr/local/lib/python3.7/dist-packages/matplotlib/contour.py in _check_xyz(self, args, kwargs)
1506
1507 if z.ndim != 2:
-> 1508 raise TypeError(f"Input z must be 2D, not {z.ndim}D")
1509 if z.shape[0] < 2 or z.shape[1] < 2:
1510 raise TypeError(f"Input z must be at least a (2, 2) shaped array, "
TypeError: Input z must be 2D, not 1D