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
  Βad Input on line 12 Azdaghost 5 1,306 Apr-19-2025, 10:22 PM
Last Post: Azdaghost
  How to revert back to a previous line from user input Sharkenn64u 2 995 Dec-28-2024, 08:02 AM
Last Post: Pedroski55
  Pandas - error when running Pycharm, but works on cmd line zxcv101 2 2,454 Sep-09-2024, 08:03 AM
Last Post: pinkang
  Input error correction. shakoun 4 1,611 Jun-07-2024, 12:59 PM
Last Post: menator01
  Receive Input on Same Line? johnywhy 8 2,690 Jan-16-2024, 03:45 AM
Last Post: johnywhy
  I want to create custom charts in Python. js1152410 1 1,183 Nov-13-2023, 05:45 PM
Last Post: gulshan212
  Getting "SSL client not supported by this Python installation" error prabirsarkar 0 1,641 Mar-13-2023, 05:01 PM
Last Post: prabirsarkar
  File "<string>", line 19, in <module> error is related to what? Frankduc 9 15,562 Mar-09-2023, 07:22 AM
Last Post: LocklearSusan
  Error in Using INPUT statement gunwaba 1 2,909 Jul-03-2022, 10:22 PM
Last Post: deanhystad
  PYQT charts in tabs frohr 10 6,748 Feb-13-2022, 04:31 PM
Last Post: Axel_Erfurt

Forum Jump:

User Panel Messages

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