{"id":12372,"date":"2024-10-25T20:14:13","date_gmt":"2024-10-25T11:14:13","guid":{"rendered":"http:\/\/pineplanter.moo.jp\/non-it-salaryman\/?p=12372"},"modified":"2024-10-25T20:14:13","modified_gmt":"2024-10-25T11:14:13","slug":"yfinance-usdjpy","status":"publish","type":"post","link":"http:\/\/pineplanter.moo.jp\/non-it-salaryman\/2024\/10\/25\/yfinance-usdjpy\/","title":{"rendered":"Python\/yfinance\u3067\u30c9\u30eb\u5186\u30c7\u30fc\u30bf\u3092\u53d6\u5f97\u3059\u308b"},"content":{"rendered":"<p>\u524d\u56de\u306b\u7d9a\u304d\u3001\u4eca\u56de\u306fPython\u3067\u30c9\u30eb\u5186\u306e\u70ba\u66ff\u30ec\u30fc\u30c8\u3092\u81ea\u52d5\u3067\u53d6\u5f97\u3059\u308b\u65b9\u6cd5\u3092\u3054\u7d39\u4ecb\u3057\u307e\u3059\u3002\u682a\u4fa1\u3068\u540c\u69d8\u306b\u3001\u300cyfinance\u300d\u3092\u4f7f\u3046\u3053\u3068\u3067\u7c21\u5358\u306b\u30c9\u30eb\u5186\u306e\u30ec\u30fc\u30c8\u3082\u53d6\u5f97\u53ef\u80fd\u3067\u3059\u3002<\/p>\n<div class=\"linkcard\"><div class=\"lkc-internal-wrap\"><a class=\"lkc-link no_icon\" href=\"http:\/\/pineplanter.moo.jp\/non-it-salaryman\/2024\/10\/25\/py-yfinance\/\" data-lkc-id=\"317\" target=\"_blank\"><div class=\"lkc-card\"><div class=\"lkc-info\"><div class=\"lkc-domain\">\u975eIT\u4f01\u696d\u306b\u52e4\u3081\u308b\u4e2d\u5e74\u30b5\u30e9\u30ea\u30fc\u30de\u30f3\u306eIT\u65e5\u8a18<\/div><\/div><div class=\"lkc-content\"><figure class=\"lkc-thumbnail\"><img decoding=\"async\" class=\"lkc-thumbnail-img\" src=\"\/\/pineplanter.moo.jp\/non-it-salaryman\/wp-content\/uploads\/2024\/10\/yfinance-150x150.png\" width=\"100px\" height=\"108px\" alt=\"\" \/><\/figure><div class=\"lkc-title\">Python\u3068yfinance\u3067\u65e5\u672c\u682a\u306e\u30c7\u30fc\u30bf\u3092\u53d6\u5f97\u3059\u308b\u65b9\u6cd5<\/div><div class=\"lkc-excerpt\">Python\u306b\u306f\u3001\u682a\u4fa1\u30c7\u30fc\u30bf\u3092\u7c21\u5358\u306b\u53d6\u5f97\u3067\u304d\u308b\u4fbf\u5229\u306a\u30e9\u30a4\u30d6\u30e9\u30ea\u304c\u3044\u304f\u3064\u304b\u3042\u308a\u307e\u3059\u304c\u3001\u7279\u306b\u300cyfinance\u300d\u306f\u3001\u7121\u6599\u3067\u624b\u8efd\u306b\u59cb\u3081\u3089\u308c\u308b\u30e9\u30a4\u30d6\u30e9\u30ea\u3068\u3057\u3066\u4eba\u6c17\u3067\u3059\u3002\u3053\u306e\u8a18\u4e8b\u3067\u306fPython\u3092\u4f7f\u3063\u3066\u300cyfinance\u300d\u3067\u682a\u4fa1\u3092\u53d6\u5f97\u3059\u308b\u65b9\u6cd5\u306b\u3064\u3044\u3066\u521d\u5fc3\u8005\u306b\u3082\u308f\u304b\u308a\u3084\u3059\u304f\u8aac\u660e\u3057\u307e\u3059\u3002\u4eca\u56de\u306f\u30c8\u30e8\u30bf\u81ea\u52d5\u8eca\u306e\u682a\u4fa1\u3092\u4f8b\u306b\u30c6\u30a3\u30c3\u30ab\u30fc\u30b7\u30f3\u30dc\u30eb\u306e\u78ba\u8a8d\u65b9\u6cd5\u304b\u3089Python\u30b3\u30fc\u30c9\u307e\u3067\u306e\u624b\u9806\u3092\u7d39\u4ecb\u3057\u307e\u3059\u3002yfinance\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u307e\u305a\u306f\u300cyfinance\u300d\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002\u3053\u306e\u30e9\u30a4\u30d6\u30e9\u30ea\u306f\u3001Yahoo Finance\u306e\u30c7\u30fc\u30bf\u3092\u53d6\u5f97\u3059\u308b\u305f\u3081\u306ePython\u30d1\u30c3\u30b1\u30fc\u30b8\u3067\u3001\u682a\u4fa1...<\/div><\/div><div class=\"clear\"><\/div><\/div><\/a><\/div><\/div>\n<h2>\u30c9\u30eb\u5186\u306e\u70ba\u66ff\u30ec\u30fc\u30c8\u3092\u53d6\u5f97\u3059\u308b\u305f\u3081\u306e\u8a2d\u5b9a<\/h2>\n<p>\u682a\u4fa1\u306e\u53d6\u5f97\u6642\u3068\u540c\u69d8\u306b\u3001\u70ba\u66ff\u30ec\u30fc\u30c8\u3082\u7279\u5b9a\u306e\u30c6\u30a3\u30c3\u30ab\u30fc\u30b7\u30f3\u30dc\u30eb\u3092\u6307\u5b9a\u3059\u308b\u3053\u3068\u3067\u53d6\u5f97\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u30c9\u30eb\u5186\u306e\u5834\u5408\u3001\u30c6\u30a3\u30c3\u30ab\u30fc\u30b7\u30f3\u30dc\u30eb\u306f\u300c<strong>JPY=X<\/strong>\u300d\u3067\u3059\u3002\u3053\u308c\u306f\u3001Yahoo Finance\u3067\u4f7f\u308f\u308c\u3066\u3044\u308b\u70ba\u66ff\u306e\u30b7\u30f3\u30dc\u30eb\u5f62\u5f0f\u3067\u30c9\u30eb\u5186\u306e\u30ec\u30fc\u30c8\u3092\u8868\u3057\u307e\u3059\u3002<\/p>\n<p>&nbsp;<\/p>\n<h2>\u30c9\u30eb\u5186\u306e\u70ba\u66ff\u30ec\u30fc\u30c8\u3092\u53d6\u5f97\u3059\u308bPython\u30b3\u30fc\u30c9<\/h2>\n<p>\u4ee5\u4e0b\u306e\u30b3\u30fc\u30c9\u3092\u5b9f\u884c\u3059\u308b\u3053\u3068\u3067\u3001\u30c9\u30eb\u5186\u306e\u70ba\u66ff\u30ec\u30fc\u30c8\u3092\u53d6\u5f97\u3067\u304d\u307e\u3059\u3002\u4eca\u56de\u306f\u3001\u300cyfinance\u300d\u306e\u6a5f\u80fd\u3092\u6d3b\u7528\u3057\u3001\u30b7\u30f3\u30d7\u30eb\u306b\u76f4\u8fd1\u306e\u30c9\u30eb\u5186\u30ec\u30fc\u30c8\u3092\u53d6\u5f97\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: python; title: ; notranslate\" title=\"\">\r\nimport yfinance as yf\r\n\r\n# \u30c9\u30eb\u5186\u306e\u30c6\u30a3\u30c3\u30ab\u30fc\u30b7\u30f3\u30dc\u30eb\r\nticker_symbol = 'JPY=X'\r\n\r\n# yfinance\u306eTicker\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u4f5c\u6210\r\nusd_jpy = yf.Ticker(ticker_symbol)\r\n\r\n# \u70ba\u66ff\u30ec\u30fc\u30c8\u30c7\u30fc\u30bf\u3092\u53d6\u5f97\uff08\u76f4\u8fd11\u65e5\uff09\r\nusd_jpy_info = usd_jpy.history(period=&quot;1d&quot;)\r\n\r\n# \u7d42\u5024\uff08Close\uff09\u3092\u53d6\u5f97\r\nclosing_price = usd_jpy_info&#x5B;'Close']&#x5B;0]\r\nprint(f&quot;\u76f4\u8fd1\u306e\u30c9\u30eb\u5186\u7d42\u5024: {closing_price}&quot;)\r\n \r\n<\/pre>\n<p>&nbsp;<\/p>\n<p>\u3053\u306e\u30b3\u30fc\u30c9\u3067\u306f\u3001\u300cJPY=X\u300d\u306e\u30c6\u30a3\u30c3\u30ab\u30fc\u30b7\u30f3\u30dc\u30eb\u3092\u4f7f\u3063\u3066\u3001\u30c9\u30eb\u5186\u306e\u70ba\u66ff\u30ec\u30fc\u30c8\u30c7\u30fc\u30bf\u3092\u53d6\u5f97\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<ul>\n<li>\u30c6\u30a3\u30c3\u30ab\u30fc\u30b7\u30f3\u30dc\u30eb\u3092\u8a2d\u5b9a\uff1a<strong>ticker_symbol<\/strong>\u306b\u300c<strong>JPY=X<\/strong>\u300d\u3092\u6307\u5b9a\u3059\u308b\u3053\u3068\u3067\u3001\u30c9\u30eb\u5186\u306e\u30ec\u30fc\u30c8\u3092\u5bfe\u8c61\u306b\u8a2d\u5b9a\u3057\u3066\u3044\u307e\u3059\u3002<\/li>\n<li>Ticker\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u4f5c\u6210\uff1a<strong>yf.Ticker<\/strong>(ticker_symbol)\u3067\u300c<strong>yfinance<\/strong>\u300d\u306eTicker\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u4f5c\u6210\u3057\u3001\u70ba\u66ff\u30ec\u30fc\u30c8\u306e\u53d6\u5f97\u3092\u53ef\u80fd\u306b\u3057\u307e\u3059\u3002<\/li>\n<li>\u30c7\u30fc\u30bf\u53d6\u5f97\uff1a<strong>usd_jpy.history(period=&#8221;1d&#8221;)<\/strong>\u3067\u76f4\u8fd11\u65e5\u5206\u306e\u30c7\u30fc\u30bf\u3092\u53d6\u5f97\u3057\u307e\u3059\u3002\u3053\u308c\u306b\u3088\u308a\u3001\u7d42\u5024\uff08Close\uff09\u306e\u307f\u3067\u306a\u304f\u3001\u59cb\u5024\uff08Open\uff09\u3084\u9ad8\u5024\uff08High\uff09\u3001\u5b89\u5024\uff08Low\uff09\u306a\u3069\u306e\u60c5\u5831\u3082\u5f97\u3089\u308c\u307e\u3059\u3002<\/li>\n<li>\u7d42\u5024\u306e\u8868\u793a\uff1ausd_jpy_info[&#8216;Close&#8217;][0]\u3067\u30c9\u30eb\u5186\u306e\u7d42\u5024\u3092\u8868\u793a\u3057\u3001\u76f4\u8fd1\u306e\u30ec\u30fc\u30c8\u3092\u7c21\u5358\u306b\u53d6\u5f97\u3067\u304d\u307e\u3059\u3002<\/li>\n<\/ul>\n<p>\u51fa\u529b\u7d50\u679c\u306f\u4ee5\u4e0b\u306e\u3068\u304a\u308a\u3067\u3059\u3002<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n\u76f4\u8fd1\u306e\u30c9\u30eb\u5186\u7d42\u5024: 151.90899658203125\r\n \r\n<\/pre>\n<p>&nbsp;<\/p>\n<h2>\u307e\u3068\u3081<\/h2>\n<p>Python\u3068\u300cyfinance\u300d\u3092\u4f7f\u3048\u3070\u3001\u30c9\u30eb\u5186\u306e\u70ba\u66ff\u30ec\u30fc\u30c8\u3092\u30ea\u30a2\u30eb\u30bf\u30a4\u30e0\u3067\u81ea\u52d5\u53d6\u5f97\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u4eca\u56de\u306f\u300cJPY=X\u300d\u3068\u3044\u3046\u30c6\u30a3\u30c3\u30ab\u30fc\u30b7\u30f3\u30dc\u30eb\u3092\u4f7f\u7528\u3057\u3001\u30b7\u30f3\u30d7\u30eb\u306a\u30b3\u30fc\u30c9\u3067\u70ba\u66ff\u30ec\u30fc\u30c8\u3092\u53d6\u5f97\u3059\u308b\u65b9\u6cd5\u3092\u7d39\u4ecb\u3057\u307e\u3057\u305f\u3002period\u306e\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u5909\u66f4\u3059\u308b\u3053\u3068\u30671\u9031\u9593\u30841\u30f6\u6708\u5206\u306e\u30ec\u30fc\u30c8\u3082\u53d6\u5f97\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u524d\u56de\u306b\u7d9a\u304d\u3001\u4eca\u56de\u306fPython\u3067\u30c9\u30eb\u5186\u306e\u70ba\u66ff\u30ec\u30fc\u30c8\u3092\u81ea\u52d5\u3067\u53d6\u5f97\u3059\u308b\u65b9\u6cd5\u3092\u3054\u7d39\u4ecb\u3057 &#8230; <\/p>\n","protected":false},"author":1,"featured_media":12115,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[37],"tags":[],"class_list":["post-12372","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-python"],"aioseo_notices":[],"_links":{"self":[{"href":"http:\/\/pineplanter.moo.jp\/non-it-salaryman\/wp-json\/wp\/v2\/posts\/12372","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/pineplanter.moo.jp\/non-it-salaryman\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/pineplanter.moo.jp\/non-it-salaryman\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/pineplanter.moo.jp\/non-it-salaryman\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/pineplanter.moo.jp\/non-it-salaryman\/wp-json\/wp\/v2\/comments?post=12372"}],"version-history":[{"count":1,"href":"http:\/\/pineplanter.moo.jp\/non-it-salaryman\/wp-json\/wp\/v2\/posts\/12372\/revisions"}],"predecessor-version":[{"id":12373,"href":"http:\/\/pineplanter.moo.jp\/non-it-salaryman\/wp-json\/wp\/v2\/posts\/12372\/revisions\/12373"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/pineplanter.moo.jp\/non-it-salaryman\/wp-json\/wp\/v2\/media\/12115"}],"wp:attachment":[{"href":"http:\/\/pineplanter.moo.jp\/non-it-salaryman\/wp-json\/wp\/v2\/media?parent=12372"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/pineplanter.moo.jp\/non-it-salaryman\/wp-json\/wp\/v2\/categories?post=12372"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/pineplanter.moo.jp\/non-it-salaryman\/wp-json\/wp\/v2\/tags?post=12372"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}