Category Hierarchy

我正在使用to_html将数据帧转换为html代码。我想去掉html输出中显示的行和列索引。但是,即使在使用index=False之后,列索引仍然显示在输出中。行索引没有出现。

service = build('sheets', 'v4', credentials=creds)

# Call the Sheets API
sheet = service.spreadsheets()
result_input = sheet.values().get(spreadsheetId=SAMPLE_SPREADSHEET_ID_input,
                            range=SAMPLE_RANGE_NAME).execute()
values_input = result_input.get('values', [])
df=pd.DataFrame(values_input)
print(df.to_html(index=False))

请看附件中的图片。0-13是我无法去掉的列索引

?

?

转载请注明出处:http://www.baquan404.com/article/20230526/2443045.html