Python 時系列分析 1,000本ノック
– ノック55: 成長率 –

Python 時系列分析 1,000本ノック– ノック55: 成長率 –
次の Python コードの出力はどれでしょうか?

Python コード:

import pandas as pd

# 年間売上データ
sales_data = [200,220,250,280,310]
years = pd.date_range(
    start='2018-01-01', 
    periods=5, freq='A')
sales_series = pd.Series(
    sales_data, index=years)

# 成長率の計算
growth = (
    (sales_series.pct_change() + 1
        ).cumprod() - 1)
print(growth.dropna().values * 100)

 

回答の選択肢:

(A) [1.10 1.25 1.40 1.55]
(B) [1.10 1.14 1.12 1.11]
(C) [10.0 13.6 12.0 10.7]
(D) [10.0 25.0 40.0 55.0]

Python 時系列分析 1,000本ノック– ノック56: グラフを描画する –

Screenshot

【月1 特定テーマ講座(10月)】
Python で学ぶ 明日からできる「欠損値処理」超入門

【開催日時】 全2回(土)2026/10/17,10/31(13:30〜18:00)
【受講形式】 当日Zoom( or 復習用に後日動画視聴)
【参加費用】 2万2千円(税込み)/人