我如何从tableWidget获取全身数据中的项目值作为数据框或列表,pyqt5 我需要帮助:)
def dataframe_generation_from_table(self, table=self.ui.tableWidget):
number_of_rows = table.rowCount()
number_of_columns = table.columnCount()
tmp_df = pd.DataFrame(
columns=range(1,11),
index=range(number_of_rows)
)
for i in range(number_of_rows):
for j in range(number_of_columns):
tmp_df.ix[i, j] = table.item(i, j).data() # this part has an error
print(tmp_df)
tmp_df.ix[i, j] = table.item(i, j).data()
TypeError:data(self,int):参数不足