# --- Pandas DataFrame 時間序列 page.57
import pandas as pd
import numpy as np


ts = pd.Series(np.random.randn(5), index=pd.date_range('20200101', periods=5))   # 頻率為日
print(ts)
print('')

ts1 = pd.Series(np.random.randn(5), index=pd.date_range('2020-01-01', periods=5, freq='M'))   # 頻率為月
print(ts1)
print('')

ts2 = pd.Series(np.random.randn(5), index=pd.date_range('2020/01/01', periods=5, freq='W'))   # 頻率為周
print(ts2)
print('')

43968bf3d5e4f62cf9aacd1d633c538d138fce4f
<mask token>

<mask token>
print(ts)
print('')
<mask token>
print(ts1)
print('')
<mask token>
print(ts2)
print('')

<mask token>
ts = pd.Series(np.random.randn(5), index=pd.date_range('20200101', periods=5))
print(ts)
print('')
ts1 = pd.Series(np.random.randn(5), index=pd.date_range('2020-01-01',
    periods=5, freq='M'))
print(ts1)
print('')
ts2 = pd.Series(np.random.randn(5), index=pd.date_range('2020/01/01',
    periods=5, freq='W'))
print(ts2)
print('')

import pandas as pd
import numpy as np
ts = pd.Series(np.random.randn(5), index=pd.date_range('20200101', periods=5))
print(ts)
print('')
ts1 = pd.Series(np.random.randn(5), index=pd.date_range('2020-01-01',
    periods=5, freq='M'))
print(ts1)
print('')
ts2 = pd.Series(np.random.randn(5), index=pd.date_range('2020/01/01',
    periods=5, freq='W'))
print(ts2)
print('')

# --- Pandas DataFrame 時間序列 page.57
import pandas as pd
import numpy as np


ts = pd.Series(np.random.randn(5), index=pd.date_range('20200101', periods=5))   # 頻率為日
print(ts)
print('')

ts1 = pd.Series(np.random.randn(5), index=pd.date_range('2020-01-01', periods=5, freq='M'))   # 頻率為月
print(ts1)
print('')

ts2 = pd.Series(np.random.randn(5), index=pd.date_range('2020/01/01', periods=5, freq='W'))   # 頻率為周
print(ts2)
print('')
