Ocorreu um erro ao utilizar o kind='reg' que não consigo identificar o que possa ser a causa. Ao final ele não plota com um reta, conforme ocorre na aula.
TypeError Traceback (most recent call last)
<ipython-input-33-a19ff08c362a> in <module>
----> 1 ax = sns.pairplot(dados, y_vars='consumo', x_vars=['temp_min','temp_media', 'temp_max', 'chuva', 'fds'], kind="reg")
2 ax.fig.suptitle('Dispersão entre as Variáveis', fontsize=20, y=1.10)
D:\Anaconda_3\lib\site-packages\seaborn\axisgrid.py in pairplot(data, hue, hue_order, palette, vars, x_vars, y_vars, kind, diag_kind, markers, height, aspect, corner, dropna, plot_kws, diag_kws, grid_kws, size)
2132 elif kind == "reg":
2133 from .regression import regplot # Avoid circular import
-> 2134 plotter(regplot, **plot_kws)
2135
2136 # Add a legend
D:\Anaconda_3\lib\site-packages\seaborn\axisgrid.py in map(self, func, **kwargs)
1363 row_indices, col_indices = np.indices(self.axes.shape)
1364 indices = zip(row_indices.flat, col_indices.flat)
-> 1365 self._map_bivariate(func, indices, **kwargs)
1366 return self
1367
D:\Anaconda_3\lib\site-packages\seaborn\axisgrid.py in _map_bivariate(self, func, indices, **kwargs)
1504 y_var = self.y_vars[i]
1505 ax = self.axes[i, j]
-> 1506 self._plot_bivariate(x_var, y_var, ax, func, kw_color, **kws)
1507 self._add_axis_labels()
1508
D:\Anaconda_3\lib\site-packages\seaborn\axisgrid.py in _plot_bivariate(self, x_var, y_var, ax, func, kw_color, **kwargs)
1534 color = self.palette[k] if kw_color is None else kw_color
1535
-> 1536 func(x, y, label=label_k, color=color, **kwargs)
1537
1538 self._clean_axis(ax)
D:\Anaconda_3\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
D:\Anaconda_3\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
D:\Anaconda_3\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
D:\Anaconda_3\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
D:\Anaconda_3\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
D:\Anaconda_3\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)
D:\Anaconda_3\lib\site-packages\seaborn\algorithms.py in <listcomp>(.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'