I prefer to use a context manager with pd.ExcelWriter('path_to_file.xlsx', mode='w') as writer: for tab_num,df in enumerate(df_list): df.to_excel(writer, sheet_name=f"sheet_{tab_num}")
I want to do something like this. the data was taken with webscrapping, so i have 3 lists. I have a column of 1 type of fruit, another column of price and another of price per kg. I would like it to only write or save to a new array, list or dictionary if the fruit (with its price1 and price per kg) includes a specific word, for example fruit in 'box' or 'bulk'. do you know how i can do it? But if its fruit shampoo dont be write or save in excel column (it has not the word box or bulk).... or at least be written and the deleted that row
Hello Tigre, I think I see what you are trying to do, but can you provide sample of the 3 list you are reference and a sample of the exported version. You can email me at contact@iamlu.net
I prefer to use a context manager
with pd.ExcelWriter('path_to_file.xlsx', mode='w') as writer:
for tab_num,df in enumerate(df_list):
df.to_excel(writer, sheet_name=f"sheet_{tab_num}")
I like your approach. By placing df in list you can just loop over list to write out to each tab. Nice!
I want to do something like this. the data was taken with webscrapping, so i have 3 lists. I have a column of 1 type of fruit, another column of price and another of price per kg. I would like it to only write or save to a new array, list or dictionary if the fruit (with its price1 and price per kg) includes a specific word, for example fruit in 'box' or 'bulk'. do you know how i can do it?
But if its fruit shampoo dont be write or save in excel column (it has not the word box or bulk).... or at least be written and the deleted that row
Hello Tigre, I think I see what you are trying to do, but can you provide sample of the 3 list you are reference and a sample of the exported version. You can email me at contact@iamlu.net
Hi Lu,
Is it possible to export dataframe to existing and open xlsm ( macro enabled workbook ) ?
Thanks
This shouldn't be a problem. I will make a video related to this.
@@codingwithluMany thanks for your response. I think I might have the answer with xlwings :)