Hi all,
I am just finishing Python Crash Course, 2nd edition and have a project I’m starting on.
I am wanting to create a work schedule that I can append data to so that I can create a call out list for when people take vacation, call in sick, etc…
The following table is the revolving 28 day schedule with 1’s showing days that are worked and zero’s showing days off.
A = [0,0,1,1,1,1,0],[0,0,0,0,0,0,1],[1,1,1,0,0,0,1],[1,1,0,1,1,1,0]
B = [1,1,1,0,0,0,1],[1,1,0,1,1,1,0],[0,0,1,1,1,1,0],[0,0,0,0,0,0,1]
C = [1,1,0,1,1,1,0],[0,0,1,1,1,1,0],[0,0,0,0,0,0,1],[1,1,1,0,0,0,1]
D = [0,0,0,0,0,0,1],[1,1,1,0,0,0,1],[1,1,0,1,1,1,0],[0,0,1,1,1,1,0]
I’ve been trying to use Timeboard and have successfully created a schedule for shift A-D but can’t seem to figure out how to transpose them to appendable files so that I can build on them with other def’s.
Any help would be greatly appreciated!!
Cheers!
Here’s what I have so far:
import timeboard as tb
import pandas as pd
class making_calendar:
A = [0,0,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,0,0,0,1,1,1,0,1,1,1,0]
B = [1,1,1,0,0,0,1,1,1,0,1,1,1,0,0,0,1,1,1,1,0,0,0,0,0,0,0,1]
C = [1,1,0,1,1,1,0,0,0,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,0,0,0,1]
D = [0,0,0,0,0,0,1,1,1,1,0,0,0,1,1,1,0,1,1,1,0,0,0,1,1,1,1,0]
def shift_A():
clnd_A = tb.Timeboard(base_unit_freq = 'D',start = '01 Jan 2022 0430', end = '01 Jan 2023 0430',
layout = [0,0,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,0,0,0,1,1,1,0,1,1,1,0])
print(clnd_A)
def shift_B():
clnd_B = tb.Timeboard(base_unit_freq = 'D',start = '01 Jan 2022 0430', end = '01 Jan 2023 0430',
layout =[1,1,1,0,0,0,1,1,1,0,1,1,1,0,0,0,1,1,1,1,0,0,0,0,0,0,0,1])
print(clnd_B)
def shift_C():
clnd_C = tb.Timeboard(base_unit_freq = 'D',start = '01 Jan 2022 0430', end = '01 Jan 2023 0430',
layout = [1,1,0,1,1,1,0,0,0,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,0,0,0,1])
print(clnd_C)
def shift_D():
clnd_D = tb.Timeboard(base_unit_freq = 'D',start = '01 Jan 2022 0430', end = '01 Jan 2023 0430',
layout = [0,0,0,0,0,0,1,1,1,1,0,0,0,1,1,1,0,1,1,1,0,0,0,1,1,1,1,0])
print(clnd_D)
shift_A()
shift_B()
shift_C()
shift_D()