To write a numeric data frame column into a PySide6 vector or array in Python, you can use the following code:
main.py475 chars13 lines
In the above code, we first extract the numeric data from the specified column in the pandas DataFrame using the tolist()
method. This will give us a Python list containing the numeric values.
Then, we create a QVector
instance and use the fromList()
method to populate it with the data from the list.
If you prefer to use a PySide6 array, you can use the QArrayDataPointer
class to create an array from the data list using the fromData()
method.
Please note that you will need to have the necessary dependencies installed, such as pandas and PySide6.
gistlibby LogSnag