Python scripts for combining excel files
I use this scripts to combined OSS stats from multiple Huawei PRS.
Hope it helps.
written in python 3
Code:
import pandas as pdimport os
import datetime
rootDir = os.getcwd()
filelist = []
excellist = []
today = datetime.date.today()
delta = datetime.timedelta(days=-1)
yesterday = today + delta
startDate = yesterday.strftime('%Y%m%d')
#get all xlsx files
for filename in os.listdir(rootDir):
if os.path.splitext(filename)[1] == '.xlsx':
filelist.append(filename)
#file name of combined file
filename_combined = startDate + 'Huawei All.xlsx'
writer = pd.ExcelWriter(filename_combined)
#read info to list
for excelfile in filelist:
excellist.append(pd.read_excel(excelfile))
#write combined info to excel file
newdf = pd.concat(excellist,sort=False)
newdf.to_excel(writer,index=False)
#save excel file
writer.save()
Re: Python scripts for combining excel files
Or you can try "Power query" which is a EXCEL plug-in published by Microsoft
it is free and it has lots of training material on internet
Re: Python scripts for combining excel files
the beauty of scripts,
in that they do all your work at night,
often on Ubuntu Server,
also add a couple of lines to the weekly report ))
Re: Python scripts for combining excel files
Quote:
Originally Posted by
BlackX
Or you can try "Power query" which is a EXCEL plug-in published by Microsoft
it is free and it has lots of training material on internet
agree totally i user power query since two years now , its really powerfull , i even stopped using PRS
Re: Python scripts for combining excel files
Hi,
I'm very fluent in python, but I prefer to use Power BI to do this kind of work. My reasons:
1. Very intuitive
2. Anyway after you combine the files I would like to make some chart
3. Visualizations a very beautiful (not just the boring Excel charts we have like 20 years seeming)
3. Power BI charts are dynamic, that means you can create for example a map to show sites by clicking a table
4. It is also FREE
Re: Python scripts for combining excel files
@jkpllan3
could share some video or tutorial to do it with Power BI , it will be very helpful
I mean how you are Power BI in RF
Re: Python scripts for combining excel files
Quote:
Originally Posted by
Boraa
@
jkpllan3
could share some video or tutorial to do it with Power BI , it will be very helpful
I mean how you are Power BI in RF
https://www.edx.org/course/analyzing...soft-dat207x-0