| 1時間目 | 2時間目 | 3時間目 | 4時間目 | |
|---|---|---|---|---|
| 4/13(月) | シンクシンク、NHK for School(英語ビート) | 学校課題(国語) | 学校課題(算数) | お絵描き |
| 4/14(火) | シンクシンク、NHK for School | 学校課題(国語) | なわとび、ラジオ体操 | NHK for School |
| 4/15(水) | シンクシンク、NHK for School | 学校課題(国語) | 学校課題(図工) | なわとび、ラジオ体操 |
| 4/16(木) | シンクシンク、NHK for School | 学校課題(国語) | 学校課題(算数) | 学校課題(学級) |
| 4/17(金) | 学校課題(理科) | シンクシンク、NHK for School | 学校課題(国語) | おうちゼミ |
| 4/18(土) | 学校課題(国語) | シンクシンク、おうちゼミ | ||
| 4/19(日) | シンクシンク、おうちゼミ | 学校課題(国語) |
Pcific time (2/1) 00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 17 18 19 20 21 22 23 00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 JST (2/1-2/2)
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
import seaborn as sns; sns.set()
df = pd.read_csv("data/applemobilitytrends-2020-04-13.csv")
transportation_type = ("driving", "transit", "walking")
fig = plt.figure(figsize=(15,15))
fig.subplots_adjust(hspace=0.5)
data_title = "Apple Maps Mobility Trends Reports"
for i, tt in enumerate(transportation_type, 1):
tf = df[(df['region'] == 'Tokyo') & (df['transportation_type'] == tt)].iloc[:,3:-1]
tf.index = ['Tokyo ' + tt]
tf = tf.transpose()
tf.index = pd.to_datetime(tf.index)
# 比較用: Pacific time での日付 (original)
tf_pt = tf.copy()
tf_pt.index = tf_pt.index.tz_localize('Japan') # merge での整合性のため
# 修正日付: JSTにして集計しなおし
tf.index = tf.index.tz_localize('US/Pacific').tz_convert('Japan')
tf_ja = tf.resample('h').ffill().resample('D').mean()
tmp = pd.merge(tf_pt, tf_ja, left_index=True, right_index=True, suffixes=[" (US/Pacific)", " (JST)"])
ax = fig.add_subplot(3,1,i)
tmp.plot(ax=ax)
ax.set_title(tt + " - " + data_title)
ax.set_ylim(0,210)
ax.legend(loc='upper right')
ax.grid(which='minor')