MCPcopy Create free account
hub / github.com/Apress/modern-pyqt / loadCSVFile

Method loadCSVFile

ch03_data_visualization/pyqt_matplotlib.py:109–117  ·  view source on GitHub ↗

Load the iris dataset and store the data in a numpy array.

(self)

Source from the content-addressed store, hash-verified

107 self.setCentralWidget(container)
108
109 def loadCSVFile(self):
110 """Load the iris dataset and store the data in a numpy array."""
111 file_name = "files/iris.csv"
112
113 with open(file_name, "r") as csv_f:
114 reader = csv.reader(csv_f)
115 header_labels = next(reader)
116 data = np.array(list(reader))
117 return data
118
119if __name__ == '__main__':
120 app = QApplication(sys.argv)

Callers 1

setupChartMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected