I'm relatively new to python so this has me scratching my head, probably because there's some concept that I have completely wrong about how this works in python.
Basically, my goal is to have a multi-dimensional array/list that will consist of 3 elements - a day number, an interval number and a dictionary of data points. Within each day, there are 48 intervals, and each interval will have a single dictionary of data.
What I'm having problems with is building the array the way that I want, but I cannot figure out how to make this work.
Here is the relevant code. How would I assign the data to the array in the format I detailed above? Everything I try gives me an assignment error. Thanks appreciate any help!
def get_intraday_data(start_date):
for day in range(0, 7):
if day == 0:
num_rows = 49
else:
num_rows = 48
for row in range(0, num_rows):
if day == 0 and row <= settings.skip_row:
interval = row
elif day == 0 and row > settings.skip_row:
interval = row - 1
elif day != 0:
interval = row
if day == 0 and row == settings.skip_row:
pass
else:
daily_data['date'] = get_date(start_date, day)
daily_data['interval'] = get_interval(day, row, interval)
daily_data['forecast_calls'] = (
get_forecast_calls(day, row, interval))
daily_data['forecast_aht'] = get_aht(day, row, interval)
daily_data['forecast_required'] = (
get_forecast_required(day, row, interval))
daily_data['calc_required'] = (
calc_required(daily_data['forecast_required'],
daily_data['forecast_aht']))
daily_data['sched_open'] = (
get_sched_open(day, row, interval))
edit: I previously read the question Here, but that is for a two-dimensional list, not three...