A working day of a data scientist visualised on a Waffle Chart - Python

DaliCodes
4 min readJul 19, 2020

--

By Dalmas Otieno

Daily I go to work and spend 8 hours. I most of the time accomplish a lot while some of the day just pass without me knowing how the day has gone. In the past week I decided to track my activities so as to get a good grip on what activities are taking much of my time. I found out that my day is usually broken down into the following sections:

  1. Presentations.

My mornings are always filled with presentations and reporting. These entail work that is in progress or findings on the analysis done the previous day.

2. Meetings.

I usually have meetings with partners and departmental members discussing inception of projects and streamlining deliverable for our clients.

3. Coding.

One of the best parts of my day is when I put on my headsets and code, giving life to ideas. In the coding phase I scrape websites, clean data, do machine learning, embed models to a back-end of a platform, post script etc.

4. Analysis.

Another best part of my day is during analysis of data where I try to find out hidden patterns within the data. This is the data torturing phase where all the data cleaned during coding phase is represented in a visually pealing and understandable manner for the folks who are none technical.

5. Slack.

Presentations and meetings are not the only communication periods of my day. I spend some time too communicating with team members on slack for the fluidity of projects’ execution.

6. Eating.

Eating does not take a lot of my time because most of the instances during my survey I was eating while working. But I spend some time moving to a restaurant or cafeteria picking breakfast or lunch. The average time I spend eating breakfast and lunch is 60 minutes a day.

7. Switching.

For all the engagements during the day, there is always time take to switch from one engagement to another. Myself it takes me more than 5 minutes to start concentrating on new engagement.

Waffle Visualization

A waffle is a visualization that helps display progress towards a goal. It is basically a square divided into a grid, usually 10 by 10 grid. The number of grid squares that are shaded or colored is usually determined by the associated metric. For example if you would like to represent the progress of a project visually, one of the tools you may consider using is a Waffle chart. You will shade cells that represent the percentage completion of the project and leave the rest not shaded. In this case the percentage use of my 8 hours is 100% and the different sections will be represented as the percentage of my day.

To make this visualization, I used python as the programming language, and matplotlib, pandas and pyWaffle as the modules that will make me accomplish this task. You can install them in your virtual environment or your global environment using the following commands:

pip install matplotlib
pip install pandas
pip install pyWaffle

The following code helps plot the chart in your favorite IDE. In my case I use jupyter lab.

# importing all necessary requirements 
import pandas as pd
import matplotlib.pyplot as plt
from pywaffle import Waffle

# creation of a dataframe
data ={'engagement': ['presentation', 'meetings', 'analysis', 'coding', 'eating','switching','slack'],
'avtime': [1, 1, 2, 2, 1,0.5,0.5]
}

df = pd.DataFrame(data)

# To plot the waffle Chart
fig = plt.figure(
FigureClass = Waffle,
rows = 10,
columns = 10,
values = df.avtime,
labels = list(df.engagement)
)
plt.show()

The output of the code is a waffle chart as shown below:

waffle of a day of a data scientist

This shows that I spend most of my time coding and doing analysis. But there is a lot of time I spend to switch from one engagement to another which I need to optimize.

Check me out on
YouTube: Dali Codes
Website: Dali Codes
More medium stories: Dali Codes

References

(Michael Alexander) How to make a Waffle Chart for Your Excel Dashboards. link
(GeeksforGeeks) Waffle Chart using pyWaffle in Python. link
pyWaffle documentation link

--

--

DaliCodes

Data Science, Data Engineering, Data Analysis and Machine Learning.