Python Forum
Line charts error "'isnan' not supported for the input types,"
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Line charts error "'isnan' not supported for the input types,"
#1
I intent to create line charts from df.

class MyTableWidget(QWidget):
    
    def __init__(self, parent):
        super(QWidget, self).__init__(parent)
        self.layout = QVBoxLayout(self)
        self.tabs = QTabWidget()
        self.tab2 = QWidget()
        self.tabs.resize(300,100)
        self.tabs.addTab(self.tab2,"Tab A")
        self.tab2.layout = QVBoxLayout(self)
        
        G1 = qtg.PlotWidget()
        G2 = qtg.PlotWidget()
        G2.setBackground('w')
        G2.showGrid(x=True, y= True)
        hour = [1,2,3,4,5,6,7,8,9,10]
        temperature = [30,32,34,32,33,31,29,32,35,45]
        pen = qtg.mkPen('r')
        G2.plot(hour,temperature,pen = pen, symbol ='+',symbolSize =30,symbolBrush='r')

        df1  = pd.read_csv('Plot12.csv')
        x = df1['Date']
        x = pd.to_datetime(df1['Date'],infer_datetime_format=True)
        y = df1['AAPL.High']
        
        G3 = qtg.PlotWidget()
        G4 = qtg.PlotWidget()
        layoutC = QGridLayout()
        layoutC.addWidget(G1,0,0,1,1)
        layoutC.addWidget(G2,0,1,1,1)
        layoutC.addWidget(G3,1,1,1,1)
        layoutC.addWidget(G4,1,0,1,1)
        G3.plot(x,y, symbol ='+',symbolSize =30,symbolBrush='r')

        self.tab2.setLayout(layoutC)
       
        # Add tabs to widget
        self.layout.addWidget(self.tabs)
I Can easily create G2 chart, but not able to create G3 chart and error as below;
Quote:TypeError: ufunc 'isnan' not supported for the input types, and the inputs could not be safely coerced to any supported types according to the casting rule ''safe''
there is no NAN or blank in my df
mine x dtype: datetime64[ns], y dtype: float64
this error came from x ?
Reply
#2
anyone help?
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Receive Input on Same Line? johnywhy 8 732 Jan-16-2024, 03:45 AM
Last Post: johnywhy
  I want to create custom charts in Python. js1152410 1 543 Nov-13-2023, 05:45 PM
Last Post: gulshan212
  Getting "SSL client not supported by this Python installation" error prabirsarkar 0 966 Mar-13-2023, 05:01 PM
Last Post: prabirsarkar
  File "<string>", line 19, in <module> error is related to what? Frankduc 9 12,588 Mar-09-2023, 07:22 AM
Last Post: LocklearSusan
  Error in Using INPUT statement gunwaba 1 2,094 Jul-03-2022, 10:22 PM
Last Post: deanhystad
  Pandas - error when running Pycharm, but works on cmd line zxcv101 1 1,374 Jun-18-2022, 01:09 PM
Last Post: snippsat
  PYQT charts in tabs frohr 10 4,415 Feb-13-2022, 04:31 PM
Last Post: Axel_Erfurt
Star I'm getting syntax error while using input function in def. yecktmpmbyrv 1 1,979 Oct-06-2021, 09:39 AM
Last Post: menator01
  Line 42 syntax error..Help!!1 patpython 4 2,685 Sep-01-2021, 03:22 PM
Last Post: deanhystad
  pandas.errors.ParserError: Error tokenizing data. C error: Expected 9 fields in line Anldra12 9 15,376 Jun-15-2021, 08:16 AM
Last Post: Anldra12

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020