0
Good morning, can you tell me what my mistake is. I use Spyder (Python 3.8)
def Graficar(self): data = self.txtingresodatos.toPlainText() data=float(data) data.plot() def anomalia(self): plt.rcParams['figure.figsize'] = (16.0, 6.0) data = self.txtingresodatos.toPlainText() data.plot() wind = 20 sigma = 2 data["suelo"] = data[0].rolling(window=wind)\ .mean() - (sigma * data[0].rolling(window=wind).std()) data["techo"] = data[0].rolling(window=wind)\ .mean() + (sigma * data[0].rolling(window=wind).std()) data.plot() data["anom"] = data.apply( lambda row: row[0] if (row[0]<=row["suelo"] or row[0]>=row["techo"]) else 0, axis=1) data.plot()
1 Odpowiedź