我正在尝试写入网络驱动器上的文件。我没有收到任何错误,但没有创建文件。有什么建议么?
# Dataframe
df = pd.DataFrame(rwb_list_departments,columns=['Owned By Team','Major Incident','Status','Priority','Incident ID','Owned By','Short Description','Requester Display Name','Created Date Time','Closed Date Time','Department','Duration','NumDur'])
# writing to local drive as csv works great
df.to_csv('rwb_itsm_processed_tickets.csv',index=False,encoding='utf-8')
# Now write file to networked drive as excel
data_folder = Path('W:/CDS Analytics/RWB')
# combine path and file
file_to_write = data_folder / 'rwb_itsm_processed_tickets.xlsx'
# Specify a writer
writer = pd.ExcelWriter('file_to_write', engine='xlsxwriter')
# Write your DataFrame to a file
df.to_excel(writer,'report')
# Save the result
writer.save()