Gostaria de saber porque ocorre esse tipo de erro:
Plotando um jointplot com a reta de regressão estimada ax = sns.jointplot(x="temp_max", y="consumo", data=dados, kind='reg') ax.fig.suptitle('Dispersão - Consumo X Temperatura', fontsize=18, y=1.05) ax.set_axis_labels("Temperatura Ma´xima", "Consumo de Cerveja", fontsize=14)
ax
TypeError Traceback (most recent call last) in ----> 1 ax = sns.jointplot(x="temp_max", y="consumo", data=dados, kind='reg') 2 ax.fig.suptitle('Dispersão - Consumo X Temperatura', fontsize=18, y=1.05) 3 ax.set_axis_labels("Temperatura Ma´xima", "Consumo de Cerveja", fontsize=14) 4 ax
~\anaconda3\lib\site-packages\seaborn\axisgrid.py in jointplot(x, y, data, kind, stat_func, color, height, ratio, space, dropna, xlim, ylim, joint_kws, marginal_kws, annot_kws, *kwargs) 2333 2334 joint_kws.setdefault("color", color) -> 2335 grid.plot_joint(regplot, *joint_kws) 2336 2337 elif kind.startswith("resid"):
~\anaconda3\lib\site-packages\seaborn\axisgrid.py in plot_joint(self, func, *kwargs) 1783 """ 1784 plt.sca(self.ax_joint) -> 1785 func(self.x, self.y, *kwargs) 1786 1787 return self
~\anaconda3\lib\site-packages\seaborn\regression.py in regplot(x, y, data, x_estimator, x_bins, x_ci, scatter, fit_reg, ci, n_boot, units, seed, order, logistic, lowess, robust, logx, x_partial, y_partial, truncate, dropna, x_jitter, y_jitter, label, color, marker, scatter_kws, line_kws, ax) 816 scatter_kws["marker"] = marker 817 line_kws = {} if line_kws is None else copy.copy(line_kws) --> 818 plotter.plot(ax, scatter_kws, line_kws) 819 return ax 820
~\anaconda3\lib\site-packages\seaborn\regression.py in plot(self, ax, scatter_kws, line_kws) 363 364 if self.fit_reg: --> 365 self.lineplot(ax, line_kws) 366 367 # Label the axes
~\anaconda3\lib\site-packages\seaborn\regression.py in lineplot(self, ax, kws) 406 """Draw the model.""" 407 # Fit the regression model --> 408 grid, yhat, err_bands = self.fit_regression(ax) 409 edges = grid[0], grid[-1] 410
~\anaconda3\lib\site-packages\seaborn\regression.py in fit_regression(self, ax, x_range, grid) 214 yhat, yhat_boots = self.fit_logx(grid) 215 else: --> 216 yhat, yhat_boots = self.fit_fast(grid) 217 218 # Compute the confidence interval at each grid point
~\anaconda3\lib\site-packages\seaborn\regression.py in fit_fast(self, grid) 239 n_boot=self.n_boot, 240 units=self.units, --> 241 seed=self.seed).T 242 yhat_boots = grid.dot(beta_boots).T 243 return yhat, yhat_boots
~\anaconda3\lib\site-packages\seaborn\algorithms.py in bootstrap(args, **kwargs) 83 for i in range(int(n_boot)): 84 resampler = integers(0, n, n) ---> 85 sample = [a.take(resampler, axis=0) for a in args] 86 boot_dist.append(f(sample, **func_kwargs)) 87 return np.array(boot_dist)
~\anaconda3\lib\site-packages\seaborn\algorithms.py in (.0) 83 for i in range(int(n_boot)): 84 resampler = integers(0, n, n) ---> 85 sample = [a.take(resampler, axis=0) for a in args] 86 boot_dist.append(f(sample, *func_kwargs)) 87 return np.array(boot_dist)
TypeError: Cannot cast array data from dtype('int64') to dtype('int32') according to the rule 'safe'