I am developing a GUI dialog using PyQT4, which imports some data into a Pandas DataFrame, and then outputs the data to the Matplotlib built-in canvas.
I would like to pass a list of variables from a DataFrame to a combo box. My first attempt:
list = list(df.parameter,unique())
self.FirstComboBox = QtGui.QComboBox()
self.FirstComboBox.addItems(list)
But when I start, I get
TypeError: QComboBox.addItems(QStringList): argument 1 has unexpected type 'list'
I have seen examples where a sorted list of dict keys is passed to a combo box, so I am confused by the fact that I can not pass the list.
Ben
source
share