Working with Excel can be a tedious daily process. In this example, we'll tackle how we can use python to programmatically work with excel data. We'll do this inside wayscript so we can use the power of cron triggers to begin automating away some of that tedious analytics work.

  • First we'll need the dependencies to make this project work. Create a requirements.txt file for your project and include the following libraries:
  • Install your dependencies into your terminal via the command:
pip install -r requirements.txt
  • Upload your excel workbook, and create a new python file. The code for this tutorial is here:
import pandas as pd

# below we're creating a dataframe python object
# We're doing this by using read_excel('<path to workbook>')
df = pd.read_excel('SampleReportsData.xlsx')

# We're doing some data processing in the following step
grouped_df = df.groupby(['Shift']).sum()
print(grouped_df['Units Produced'])

Video Tutorial URL: