Python 時系列分析 1,000本ノック
– ノック27: 時系列データの四半期の変更 –

Python 時系列分析 1,000本ノック– ノック27: 時系列データの四半期の変更 –
次の Python コードの出力はどれでしょうか?

Python コード:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
import pandas as pd
date = pd.Timestamp('2023-06-15')
quarter = date.to_period('Q')
new_quarter = quarter.asfreq('Q-NOV')
print(new_quarter)
import pandas as pd date = pd.Timestamp('2023-06-15') quarter = date.to_period('Q') new_quarter = quarter.asfreq('Q-NOV') print(new_quarter)
import pandas as pd

date = pd.Timestamp('2023-06-15')
quarter = date.to_period('Q')
new_quarter = quarter.asfreq('Q-NOV')

print(new_quarter)

 

回答の選択肢:

(A) 2023Q2
(B) 2024Q2
(C) 2023Q3
(D) 2024Q3