我导入了文件并从工作表中提取了“批处理12”行。
df = pd.read_excel (r'F:\Tutorials\PIAIC\AI Batch 12 Peshawar\Quarter 2\AIC Result.xlsx')
df[df['Batch']==('Batch 12')]现在,我想将这个更新的“批处理12”的DataFrame导出到一个excel文件中,但是导出后不会更新excel文件。
df.to_excel(r'F:\\Tutorials\\PIAIC\\AI Batch 12 Peshawar\\Quarter 2\\New.xlsx',index=False)发布于 2022-01-04 08:37:38
您必须为代码的输出分配一个值,如下所示:
df = df[df['Batch']=='Batch 12']https://stackoverflow.com/questions/70575115
复制相似问题