title: How to display a Pandas data frame with PyQt5/PySide2
body: <p>I have a problem with the line below <code>self.tableView.set??????????(df)</code> that supposed to display the data frame in PyQt5. I put ??? there where I am missing the code I need.</p>
  
  <pre><code>def btn_clk(self):
          path = self.lineEdit.text()
          df = pd.read_csv(path)
          self.tableView.set??????????(df)
  </code></pre>
  
  <p>The rest of the code works, because if I use <code>print(df)</code> in the above code, the data frame is printed in the IPython console. So, Pandas reads the CSV and prints it.</p>
  
  <p>But, I tried many things to get it displayed in PyQt5 and nothing works. I am not very familiar with PyQt, just started to play around with it and I am stuck here.</p>
  
  <p>Here is my code:</p>
  
  <pre><code>from PyQt5 import QtCore, QtGui, QtWidgets
  import pandas as pd
  class Ui_MainWindow(object):
      def setupUi(self, MainWindow):
          MainWindow.setObjectName("MainWindow")
          MainWindow.resize(662, 512)
          self.centralwidget = QtWidgets.QWidget(MainWindow)
          self.centralwidget.setObjectName("centralwidget")
          self.horizontalLayout = QtWidgets.QHBoxLayout(self.centralwidget)
          self.horizontalLayout.setObjectName("horizontalLayout")
          self.verticalLayout = QtWidgets.QVBoxLayout()
          self.verticalLayout.setObjectName("verticalLayout")
          self.lineEdit = QtWidgets.QLineEdit(self.centralwidget)
          self.lineEdit.setObjectName("lineEdit")
          self.verticalLayout.addWidget(self.lineEdit)
          self.tableView = QtWidgets.QTableView(self.centralwidget)
          self.tableView.setObjectName("tableView")
          self.verticalLayout.addWidget(self.tableView)
          self.pushButton = QtWidgets.QPushButton(self.centralwidget)
          self.pushButton.setObjectName("pushButton")
          self.verticalLayout.addWidget(self.pushButton)
          self.horizontalLayout.addLayout(self.verticalLayout)
          MainWindow.setCentralWidget(self.centralwidget)
          self.menubar = QtWidgets.QMenuBar(MainWindow)
          self.menubar.setGeometry(QtCore.QRect(0, 0, 662, 21))
          self.menubar.setObjectName("menubar")
          MainWindow.setMenuBar(self.menubar)
          self.statusbar = QtWidgets.QStatusBar(MainWindow)
          self.statusbar.setObjectName("statusbar")
          MainWindow.setStatusBar(self.statusbar)
  
          self.retranslateUi(MainWindow)
          QtCore.QMetaObject.connectSlotsByName(MainWindow)
  
      def retranslateUi(self, MainWindow):
          _translate = QtCore.QCoreApplication.translate
          MainWindow.setWindowTitle(_translate("MainWindow", "MainWindow"))
          self.pushButton.setText(_translate("MainWindow", "PushButton"))
  
  
          self.pushButton.clicked.connect(self.btn_clk)
  
          MainWindow.show()
  
      def btn_clk(self):
          path = self.lineEdit.text()
          df = pd.read_csv(path)
          self.tableView.set????????????(df)
  
  
  if __name__ == "__main__":
      import sys
      app = QtWidgets.QApplication(sys.argv)
      MainWindow = QtWidgets.QMainWindow()
      ui = Ui_MainWindow()
      ui.setupUi(MainWindow)
      MainWindow.show()
      sys.exit(app.exec_())
  </code></pre>