+ 1

How to convert this to float. I use Spyder (Python 3.8)

data=self.txtingresodatos.toPlainText() data.plot

19th Nov 2020, 4:35 PM
Astrid
Astrid - avatar
9 odpowiedzi
+ 7
Luisa , it might be better to show us your complete code. You can put it in playground and link it here. Thanks!
19th Nov 2020, 8:43 PM
Lothar
Lothar - avatar
+ 4
Sorry, no chance to help you. I did a try with spyder, where all modules are installed. The code you provided seems to be not complete, and there are files missing e.g. "anomalia.ui".
20th Nov 2020, 5:34 PM
Lothar
Lothar - avatar
+ 1
data = float(data) #? data.plot()
19th Nov 2020, 6:46 PM
Jayakrishna 🇮🇳
+ 1
data=self.txtingresodatos.toPlainText () data=float (data) data.plot()
21st Nov 2020, 10:25 AM
Aradhay Mathur
Aradhay Mathur - avatar
0
import sys from PyQt5 import uic, QtWidgets #Librerias para manejo de imagenes from PyQt5.QtWidgets import * from PyQt5.QtGui import QImage,QPalette,QBrush from PyQt5.QtCore import QSize from math import* #otras librerias import pandas as pd import numpy as np import matplotlib.pyplot as plt #Nombre de nuestro archivo ui qtCreatorFile = "anomalia.ui" Ui_MainWindow,QtBaseClass = uic.loadUiType(qtCreatorFile) #Clase de la ventana class VentanaPrincipal(QtWidgets.QMainWindow,Ui_MainWindow): #Metodo constructor de la clase def __init__(self): QtWidgets.QMainWindow.__init__(self) Ui_MainWindow.__init__(self) self.setupUi(self) #Declaramos el Signal -> Objeto pushButton y el Slots-> Metodo self.btnGraficar.clicked.connect(self.Graficar) self.btnGuardar.clicked.connect(self.Guardar) self.btnAnomalia.clicked.connect(self.anomalia) def Graficar(self): data = self.txtingresodatos.toPlainText()
19th Nov 2020, 8:46 PM
Astrid
Astrid - avatar
0
Hello Lothar this is the code.
19th Nov 2020, 8:46 PM
Astrid
Astrid - avatar
0
thanks anomalia.ui is a form
20th Nov 2020, 5:41 PM
Astrid
Astrid - avatar
0
is that the problem is in def graph and anomaly because it does not work, when I write the data I will appear Str and rolling.
20th Nov 2020, 5:42 PM
Astrid
Astrid - avatar
0
I have tried to correct it several times, but I get the same error.
20th Nov 2020, 5:43 PM
Astrid
Astrid - avatar