1, 1) 2 end = pd.datetime(2018, 1, 31) 3 date_index = pd.date_range(start=start, end=end) 4 5 mu = 40 6 mu_week = [-2, -4, 0, 1, 7, 8, 3] 7 s = 4 8 9 10 def mu_season(x): 11 if (x % 365) < 31: 12 return -0.3*(x % 365) + 10 13 elif 31 <= (x % 365) < 90: 14 return 0.15*((x % 365)-31) 15 elif 90 <= (x % 365) < 212: 16 return -0.09*((x % 365)-90) + 10 17 elif 212 <= (x % 365) < 243: 18 return 0.3*((x % 365)-212) 19 elif 243 <= (x % 365) < 273: 20 return -0.3*((x % 365)-243)+10 21 elif 273 <= (x % 365): 22 return 0.11*((x % 365)-273) 23 24 25 Y = [] 26 np.random.seed(1234) 27 for i in range(len(date_index)): 28 Y.append(np.absolute(np.floor(np.random.normal(loc=mu + mu_week[i % 7] + mu_season(i), scale=s)))) 29 30 daily_customers = pd.DataFrame(data={'date': date_index, 'customers': Y}, index=date_index) ٙࣅσʔλ ੜ 1 ax = daily_customers['customers'].plot(figsize=(8, 4), grid=True, color='black') 2 ax.set_ylabel('customers') 3 fig = ax.get_figure() ඳը