简体   繁体   中英

I am running the code below in python and getting the error 'AttributeError: 'QgridWidget' object has no attribute 'to_excel''

I am trying to use to excel function using the code below. I am getting the error df.to_excel('dataset1.xlsx')

Below is the code.

df=qgrid.show_grid(data)
df.to_excel('dataset1.xlsx')

qgrid.show_grid() returns a QgridWidget instance. You can access the underlying dataframe using the df attribute:

grid = qgrid.show_grid(data)
grid.df.to_excel('dataset1.xlsx')

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM