Pythonで学ぶファイナンシャル・フォーキャスティング
Victoria Clark
CGMA Financial Analyst
日付形式が異なる場合がある
以下の点で問題が生じる
順序なしのキーと値のペア
例:
dictionary = {01: 'Jan'}

| ディレクティブ | 意味 | 例 |
|---|---|---|
| %d | 月の日(ゼロ埋め10進数) | 01, 02, …, 31 |
| %b | ロケールの略称による月名 | Jan, Feb, …, Dec |
| %B | ロケールの完全な月名 | January, …, |
| %m | 月(ゼロ埋め10進数) | 01, 02, …, 12 |
| %y | 世紀なしの年(ゼロ埋め10進数) | 00, 01, …, 99 |
| %Y | 世紀ありの年(10進数) | 1988, 2001, 2013 |
# Example: 19-02-2018 will be written:
('19-02-2018', '%d-%m-%Y')
iteritems() 関数# Create dictionary with strings as keys
# and ints as values
wordFrequency = {
"Hello" : 7,
"hi" : 10,
"there" : 45,
"at" : 23,
"this" : 77
}
# Iterate over dictionary using for loop
for key in wordFrequency:
value = wordFrequency[key]
print(key, " :: ", value)
Hello :: 7
there :: 45
at :: 23
this :: 77
hi :: 10
Pythonで学ぶファイナンシャル・フォーキャスティング