diff --git a/examples/20220825-000-write-refresh_token.ipynb b/examples/20220825-000-write-refresh_token.ipynb
index aa1ef40..58530ab 100644
--- a/examples/20220825-000-write-refresh_token.ipynb
+++ b/examples/20220825-000-write-refresh_token.ipynb
@@ -1 +1 @@
-{"cells":[{"cell_type":"markdown","metadata":{"id":"8gKDRhrY0mrO"},"source":["# リフレッシュトークンの書き込み\n","\n","[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/J-Quants/jquants-api-client-python/blob/master/examples/20220825-000-write-refresh_token.ipynb)\n","\n","J-Quants API のリフレッシュトークンを Google Drive の MyDrive/drive_ws/secret/jquantsapi-key.txt に書き込みます。\n","\n","リフレッシュトークンは取得方法は以下のリンク先をご参照ください。\n","\n","https://jpx.gitbook.io/j-quants-api/api-reference#idtkunno\n","\n","\n","----\n","\n","**このノートブックはGoogle Driveを使用します。**\n","\n","- Google Drive の以下のファイルにリフレッシュトークンを書き込みます。\n"," - `MyDrive/drive_ws/secret/jquantsapi-key.txt`\n"]},{"cell_type":"code","execution_count":null,"metadata":{"id":"pQVIcLjryiMq"},"outputs":[],"source":["# Google drive をマウントします\n","from google.colab import drive\n","drive.mount('/content/drive')\n","\n","# 必要なモジュールを読み込みます\n","import os\n","from getpass import getpass\n","\n","\n","# refresh_token を入力します\n","refresh_token = getpass(\"Please input refresh token\")\n","\n","# refresh_token の書き込み先を指定します\n","OUTPUT_DIR = \"/content/drive/MyDrive/drive_ws/secret\"\n","OUTPUT_PATH = f\"{OUTPUT_DIR}/jquantsapi-key.txt\"\n","\n","# refresh_token を書き込みます\n","os.makedirs(OUTPUT_DIR, exist_ok=True)\n","with open(OUTPUT_PATH, mode=\"w\") as f:\n"," f.write(refresh_token)\n","\n","# 完了文字列を表示します\n","print(\"Done\")"]},{"cell_type":"code","execution_count":null,"metadata":{"id":"S3wxpLKm0fGN"},"outputs":[],"source":[]}],"metadata":{"colab":{"authorship_tag":"ABX9TyMvkFqt1b8LuOi5OXQ4CqdB","collapsed_sections":[],"name":"20220825-000-write-refresh_token.ipynb","provenance":[]},"kernelspec":{"display_name":"Python 3","name":"python3"},"language_info":{"name":"python"}},"nbformat":4,"nbformat_minor":0}
+{"cells":[{"attachments":{},"cell_type":"markdown","metadata":{"id":"8gKDRhrY0mrO"},"source":["# リフレッシュトークンの書き込み\n","\n","[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/J-Quants/jquants-api-client-python/blob/master/examples/20220825-000-write-refresh_token.ipynb)\n","\n","J-Quants API のリフレッシュトークンを Google Drive の MyDrive/drive_ws/secret/jquantsapi-key.txt に書き込みます。\n","\n","リフレッシュトークンは取得方法は以下のリンク先をご参照ください。\n","\n","https://jpx.gitbook.io/j-quants-ja/outline/getstarted#step2rifuresshutkunnoreapino\n","\n","\n","----\n","\n","**このノートブックはGoogle Driveを使用します。**\n","\n","- Google Drive の以下のファイルにリフレッシュトークンを書き込みます。\n"," - `MyDrive/drive_ws/secret/jquantsapi-key.txt`\n"]},{"cell_type":"code","execution_count":null,"metadata":{"id":"pQVIcLjryiMq"},"outputs":[],"source":["# Google drive をマウントします\n","from google.colab import drive\n","drive.mount('/content/drive')\n","\n","# 必要なモジュールを読み込みます\n","import os\n","from getpass import getpass\n","\n","\n","# refresh_token を入力します\n","refresh_token = getpass(\"Please input refresh token\")\n","\n","# refresh_token の書き込み先を指定します\n","OUTPUT_DIR = \"/content/drive/MyDrive/drive_ws/secret\"\n","OUTPUT_PATH = f\"{OUTPUT_DIR}/jquantsapi-key.txt\"\n","\n","# refresh_token を書き込みます\n","os.makedirs(OUTPUT_DIR, exist_ok=True)\n","with open(OUTPUT_PATH, mode=\"w\") as f:\n"," f.write(refresh_token)\n","\n","# 完了文字列を表示します\n","print(\"Done\")"]},{"cell_type":"code","execution_count":null,"metadata":{"id":"S3wxpLKm0fGN"},"outputs":[],"source":[]}],"metadata":{"colab":{"authorship_tag":"ABX9TyMvkFqt1b8LuOi5OXQ4CqdB","collapsed_sections":[],"name":"20220825-000-write-refresh_token.ipynb","provenance":[]},"kernelspec":{"display_name":"Python 3","name":"python3"},"language_info":{"codemirror_mode":{"name":"ipython","version":3},"file_extension":".py","mimetype":"text/x-python","name":"python","nbconvert_exporter":"python","pygments_lexer":"ipython3","version":"3.11.1"}},"nbformat":4,"nbformat_minor":0}
diff --git a/examples/20220825-002-sector.ipynb b/examples/20220825-002-sector.ipynb
index ff5f350..ec24d96 100644
--- a/examples/20220825-002-sector.ipynb
+++ b/examples/20220825-002-sector.ipynb
@@ -101,15 +101,6 @@
"japanize_matplotlib.japanize()"
]
},
- {
- "cell_type": "code",
- "execution_count": null,
- "metadata": {
- "id": "8JRXB-JIQnDg"
- },
- "outputs": [],
- "source": []
- },
{
"cell_type": "code",
"execution_count": null,
@@ -125,15 +116,6 @@
"STORAGE_DIR_PATH"
]
},
- {
- "cell_type": "code",
- "execution_count": null,
- "metadata": {
- "id": "rkEQDOUlQqCN"
- },
- "outputs": [],
- "source": []
- },
{
"cell_type": "code",
"execution_count": null,
@@ -173,15 +155,6 @@
"refresh_token = get_refresh_token()"
]
},
- {
- "cell_type": "code",
- "execution_count": null,
- "metadata": {
- "id": "CI9C-h6iQXsG"
- },
- "outputs": [],
- "source": []
- },
{
"cell_type": "code",
"execution_count": null,
@@ -194,24 +167,6 @@
"jqapi = jquantsapi.Client(refresh_token=refresh_token)"
]
},
- {
- "cell_type": "code",
- "execution_count": null,
- "metadata": {
- "id": "d6Y5q9AesDK0"
- },
- "outputs": [],
- "source": []
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "metadata": {
- "id": "xH2PYF0ENVYa"
- },
- "outputs": [],
- "source": []
- },
{
"cell_type": "code",
"execution_count": null,
@@ -222,9 +177,7 @@
"source": [
"# 銘柄情報を取得します\n",
"now = pd.Timestamp.now(tz=\"Asia/Tokyo\")\n",
- "if now.hour < 22:\n",
- " # データ更新時間前の場合は日付を1日ずらします。\n",
- " now -= pd.Timedelta(1, unit=\"D\")\n",
+ "\n",
"list_file = f\"{STORAGE_DIR_PATH}/list_{now.strftime('%Y%m%d')}.csv.gz\"\n",
"if not os.path.isfile(list_file):\n",
" # 保存されているデータが存在しない場合はAPIからデータを取得します\n",
@@ -250,15 +203,6 @@
"df_list.tail(2)"
]
},
- {
- "cell_type": "code",
- "execution_count": null,
- "metadata": {
- "id": "THYjJg2Xsb6I"
- },
- "outputs": [],
- "source": []
- },
{
"cell_type": "code",
"execution_count": null,
@@ -289,15 +233,6 @@
" ax.annotate(str(p.get_height()), (p.get_x() * 1.005, p.get_height() * 1.005))"
]
},
- {
- "cell_type": "code",
- "execution_count": null,
- "metadata": {
- "id": "KRrlEQABsb0L"
- },
- "outputs": [],
- "source": []
- },
{
"cell_type": "code",
"execution_count": null,
@@ -312,7 +247,7 @@
"# 過去6ヶ月のデータを取得\n",
"start_dt = now - pd.Timedelta(190, unit=\"D\") # 計算用に10日分多めに指定しています\n",
"end_dt = now\n",
- "if end_dt.hour < 19:\n",
+ "if end_dt.hour < 18:\n",
" # データ更新時間前の場合は日付を1日ずらします。\n",
" end_dt -= pd.Timedelta(1, unit=\"D\")\n",
"price_file = f\"{STORAGE_DIR_PATH}/price_{start_dt.strftime('%Y%m%d')}_{end_dt.strftime('%Y%m%d')}.csv.gz\"\n",
@@ -440,7 +375,7 @@
"df_work = pd.merge(df_work, df_list[[\"Code\", \"Sector33Code\", \"Sector33CodeName\", \"MarketCode\"]], on=[\"Code\"])\n",
"\n",
"# プライム銘柄に絞り込みます\n",
- "df_work = df_work.loc[df_work[\"MarketCode\"] == \"111\"]\n",
+ "df_work = df_work.loc[df_work[\"MarketCode\"] == \"0111\"]\n",
"\n",
"# 6ヶ月、3ヶ月、および基準日を出力します\n",
"display(base_6months_date, base_3months_date, evaluation_date)\n",
@@ -489,4 +424,4 @@
},
"nbformat": 4,
"nbformat_minor": 0
-}
\ No newline at end of file
+}
diff --git a/examples/20220825-003-dividend.ipynb b/examples/20220825-003-dividend.ipynb
index f0279fc..44de27d 100644
--- a/examples/20220825-003-dividend.ipynb
+++ b/examples/20220825-003-dividend.ipynb
@@ -1 +1 @@
-{"cells":[{"cell_type":"markdown","metadata":{"id":"OtR4VmnRshQX"},"source":["# 配当利回り\n","\n","[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/J-Quants/jquants-api-client-python/blob/master/examples/20220825-003-dividend.ipynb)\n","\n","\n","このノートブックでは J-Quants APIから取得できるデータから配当性向、配当利回り、および直近1,3ヶ月のリターンを一覧で表示します。\n","\n","\n","----\n","\n","**このノートブックはGoogle Driveを使用します。**\n","\n","- Google Drive の以下のファイルにリフレッシュトークンが書き込まれていることを想定しています。\n"," - `MyDrive/drive_ws/secret/jquantsapi-key.txt`\n","- Google Drive の以下のフォルダーにデータを書き込みます。\n"," - `MyDrive/drive_ws/marketdata`"]},{"cell_type":"code","execution_count":null,"metadata":{"id":"9REtVkPaGx7Y"},"outputs":[],"source":["# 必要なモジュールをインストールします。\n","! python -m pip install jquants-api-client japanize-matplotlib"]},{"cell_type":"code","execution_count":null,"metadata":{"id":"ilrdZjP4KknF"},"outputs":[],"source":["# Google drive をマウントします。\n","from google.colab import drive\n","drive.mount('/content/drive')"]},{"cell_type":"code","execution_count":null,"metadata":{"id":"A5fW3HxGN__3"},"outputs":[],"source":["import os\n","from datetime import datetime\n","\n","import japanize_matplotlib\n","import jquantsapi\n","import matplotlib.pyplot as plt\n","import numpy as np\n","import pandas as pd\n","import seaborn as sns"]},{"cell_type":"code","execution_count":null,"metadata":{"id":"3CeWabhlOGE4"},"outputs":[],"source":["# pandas の表示制限を調整します\n","pd.set_option(\"display.max_rows\", 1000)\n","pd.set_option(\"display.max_columns\", 1000)\n","pd.set_option(\"display.width\", 2000)"]},{"cell_type":"code","execution_count":null,"metadata":{"id":"8JRXB-JIQnDg"},"outputs":[],"source":["# プロット用の設定をします\n","sns.set(rc={'figure.figsize': (15, 10)})\n","sns.set(font_scale=1.5)\n","sns.set_style('whitegrid')\n","\n","japanize_matplotlib.japanize()"]},{"cell_type":"code","execution_count":null,"metadata":{"id":"_ywQToB0UPCc"},"outputs":[],"source":[]},{"cell_type":"code","execution_count":null,"metadata":{"id":"fSG_cbO7Qm4x"},"outputs":[],"source":["# 一度取得したデータは Google Drive 上に保存して再利用します。\n","# 保存先ディレクトリを指定します。\n","STORAGE_DIR_PATH = \"/content/drive/MyDrive/drive_ws/marketdata\"\n","os.makedirs(STORAGE_DIR_PATH, exist_ok=True)\n","STORAGE_DIR_PATH"]},{"cell_type":"code","execution_count":null,"metadata":{"id":"rkEQDOUlQqCN"},"outputs":[],"source":[]},{"cell_type":"code","execution_count":null,"metadata":{"id":"fIRnvS9kOOqI"},"outputs":[],"source":["# J-Quants APIのトークンを保存してあるファイルを指定します\n","REFRESH_TOKEN_FILE_PATH = \"/content/drive/MyDrive/drive_ws/secret/jquantsapi-key.txt\""]},{"cell_type":"code","execution_count":null,"metadata":{"id":"dHm6w6O_QUnS"},"outputs":[],"source":["def get_refresh_token(refresh_token_file_path: str = REFRESH_TOKEN_FILE_PATH):\n"," with open(refresh_token_file_path, \"r\") as f:\n"," refresh_token = f.read()\n"," return refresh_token.rstrip().lstrip()"]},{"cell_type":"code","execution_count":null,"metadata":{"id":"9Ts2dfaRQV9C"},"outputs":[],"source":["# ファイルからリフレッシュトークンを読み込みます\n","refresh_token = get_refresh_token()"]},{"cell_type":"code","execution_count":null,"metadata":{"id":"CI9C-h6iQXsG"},"outputs":[],"source":[]},{"cell_type":"code","execution_count":null,"metadata":{"id":"7ZH_LuWUQYk8"},"outputs":[],"source":["# J-Quants APIクライアントを初期化します\n","jqapi = jquantsapi.Client(refresh_token=refresh_token)"]},{"cell_type":"code","execution_count":null,"metadata":{"id":"d6Y5q9AesDK0"},"outputs":[],"source":[]},{"cell_type":"code","execution_count":null,"metadata":{"id":"2KkfboPHsYd9"},"outputs":[],"source":["# 銘柄情報を取得します\n","now = pd.Timestamp.now(tz=\"Asia/Tokyo\")\n","if now.hour < 22:\n"," # データ更新時間前の場合は日付を1日ずらします。\n"," now -= pd.Timedelta(1, unit=\"D\")\n","list_file = f\"{STORAGE_DIR_PATH}/list_{now.strftime('%Y%m%d')}.csv.gz\"\n","if not os.path.isfile(list_file):\n"," df_list = jqapi.get_list()\n"," df_list.to_csv(list_file, compression=\"gzip\", index=False)\n"," print(f\"save file: {list_file}\")\n","\n","# ファイルからデータを読み込みます\n","print(f\"file exists: {list_file}, loading\")\n","df_list = pd.read_csv(list_file, dtype=\"str\")"]},{"cell_type":"code","execution_count":null,"metadata":{"id":"xH2PYF0ENVYa"},"outputs":[],"source":["# 株価情報を取得します\n","now = pd.Timestamp.now(tz=\"Asia/Tokyo\")\n","# 過去3ヶ月のデータを取得\n","start_dt = now - pd.Timedelta(95, unit=\"D\")\n","end_dt = now\n","if end_dt.hour < 19:\n"," # データ更新時間前の場合は日付を1日ずらします。\n"," end_dt -= pd.Timedelta(1, unit=\"D\")\n","price_file = f\"{STORAGE_DIR_PATH}/price_{start_dt.strftime('%Y%m%d')}_{end_dt.strftime('%Y%m%d')}.csv.gz\"\n","if not os.path.isfile(price_file):\n"," df_p = jqapi.get_price_range(start_dt=start_dt, end_dt=end_dt)\n"," df_p.to_csv(price_file, compression=\"gzip\", index=False)\n"," df_p.reset_index(drop=True, inplace=True)\n"," print(f\"save file: {price_file}\")\n","\n","# データを読み込みます\n","print(f\"file exists: {price_file}, loading\")\n","df_p = pd.read_csv(price_file, dtype=\"str\")\n","df_p.reset_index(drop=True, inplace=True)\n","# 各列のデータ型を調整します\n","df_p.loc[:, \"Date\"] = pd.to_datetime(df_p[\"Date\"], format=\"%Y-%m-%d\")\n","df_p.loc[:, \"Open\"] = df_p[\"Open\"].astype(np.float64)\n","df_p.loc[:, \"High\"] = df_p[\"High\"].astype(np.float64)\n","df_p.loc[:, \"Low\"] = df_p[\"Low\"].astype(np.float64)\n","df_p.loc[:, \"Close\"] = df_p[\"Close\"].astype(np.float64)\n","df_p.loc[:, \"Volume\"] = df_p[\"Volume\"].astype(np.float64)\n","df_p.loc[:, \"TurnoverValue\"] = df_p[\"TurnoverValue\"].astype(np.float64)\n","df_p.loc[:, \"AdjustmentFactor\"] = df_p[\"AdjustmentFactor\"].astype(np.float64)\n","df_p.loc[:, \"AdjustmentOpen\"] = df_p[\"AdjustmentOpen\"].astype(np.float64)\n","df_p.loc[:, \"AdjustmentHigh\"] = df_p[\"AdjustmentHigh\"].astype(np.float64)\n","df_p.loc[:, \"AdjustmentLow\"] = df_p[\"AdjustmentLow\"].astype(np.float64)\n","df_p.loc[:, \"AdjustmentClose\"] = df_p[\"AdjustmentClose\"].astype(np.float64)\n","df_p.loc[:, \"AdjustmentVolume\"] = df_p[\"AdjustmentVolume\"].astype(np.float64)"]},{"cell_type":"code","execution_count":null,"metadata":{"id":"dzZL0Krs2gUe"},"outputs":[],"source":["# 過去3ヶ月に発表された財務情報を取得します\n","now = pd.Timestamp.now(tz=\"Asia/Tokyo\")\n","start_dt = now - pd.Timedelta(90, unit=\"D\")\n","end_dt = now\n","if end_dt.hour < 1:\n"," # データ更新時間前の場合は日付を1日ずらします。\n"," end_dt -= pd.Timedelta(1, unit=\"D\")\n","statements_file = f\"{STORAGE_DIR_PATH}/statements_{start_dt.strftime('%Y%m%d')}_{end_dt.strftime('%Y%m%d')}.csv.gz\"\n","if not os.path.isfile(statements_file):\n"," cache_dir = f\"{STORAGE_DIR_PATH}/raw_statements\"\n"," os.makedirs(cache_dir, exist_ok=True)\n"," df_s = jqapi.get_statements_range(\n"," start_dt=start_dt, end_dt=end_dt, cache_dir=cache_dir\n"," )\n"," df_s.to_csv(statements_file, compression=\"gzip\", index=False)\n"," print(f\"save file: {statements_file}\")\n","\n","print(f\"file exists: {statements_file}, loading\")\n","df_s = pd.read_csv(statements_file, dtype=\"str\")\n","# float64にするために\"-\"をnp.nanに置き換えます\n","df_s.replace({\"-\": np.nan}, inplace=True)\n","df_s[\"ResultDividendPerShareFiscalYearEnd\"] = df_s[\"ResultDividendPerShareFiscalYearEnd\"].astype(np.float64)\n","df_s[\"EarningsPerShare\"] = df_s[\"EarningsPerShare\"].astype(np.float64)\n","df_s[\"ForecastDividendPerShareAnnual\"] = df_s[\"ForecastDividendPerShareAnnual\"].astype(np.float64)\n","df_s[\"ForecastEarningsPerShare\"] = df_s[\"ForecastEarningsPerShare\"].astype(np.float64)\n","# 日付型に変換します\n","df_s.loc[:, \"DisclosedDate\"] = pd.to_datetime(\n"," df_s[\"DisclosedDate\"], format=\"%Y-%m-%d\"\n",")\n","df_s.loc[:, \"CurrentPeriodEndDate\"] = pd.to_datetime(\n"," df_s[\"CurrentPeriodEndDate\"], format=\"%Y-%m-%d\"\n",")\n","df_s.loc[:, \"CurrentFiscalYearStartDate\"] = pd.to_datetime(\n"," df_s[\"CurrentFiscalYearStartDate\"], format=\"%Y-%m-%d\"\n",")\n","df_s.loc[:, \"CurrentFiscalYearEndDate\"] = pd.to_datetime(\n"," df_s[\"CurrentFiscalYearEndDate\"], format=\"%Y-%m-%d\"\n",")\n","df_s.sort_values(\"DisclosedUnixTime\", inplace=True)"]},{"cell_type":"code","execution_count":null,"metadata":{"id":"dtWhPh-_oMmt"},"outputs":[],"source":["# 作業用にデータをコピーします\n","df_work = df_s.copy()\n","df_p_work = df_p.copy()"]},{"cell_type":"code","execution_count":null,"metadata":{"id":"bkbOMxaIOSVc"},"outputs":[],"source":["# 財務情報を銘柄ごとに重複を排除して最新の財務情報のみを使用します\n","df_work.sort_values(\"DisclosedUnixTime\", inplace=True)\n","df_work = df_work.drop_duplicates([\"LocalCode\"], keep=\"last\")\n","\n","# 終値が0の場合は前営業日の終値を使用します\n","df_p_work.sort_values([\"Code\", \"Date\"], inplace=True)\n","df_p_work[\"AdjustmentClose\"].replace({0.0: np.nan}, inplace=True)\n","df_p_work.loc[:, \"AdjustmentClose\"] = df_p_work.groupby(\"Code\")[\"AdjustmentClose\"].ffill()\n","# 終値がnanの場合は翌営業日の終値を使用します (データの先頭)\n","df_p_work.loc[:, \"AdjustmentClose\"] = df_p_work.groupby(\"Code\")[\"AdjustmentClose\"].bfill()\n","# 各銘柄の直近のリターンを算出します\n","def _calc_return(df, bdays):\n"," return (df[\"AdjustmentClose\"].iat[-1] / df[\"AdjustmentClose\"].iloc[-bdays:].iat[0]) - 1\n","df_p_work.sort_values([\"Code\", \"Date\"], inplace=True)\n","df_returns_1months = df_p_work.groupby(\"Code\").apply(_calc_return, 20).rename(\"1ヶ月リターン\")\n","df_returns_3months = df_p_work.groupby(\"Code\").apply(_calc_return, 60).rename(\"3ヶ月リターン\")\n","# リターンと結合します\n","df_work = pd.merge(df_work, df_returns_1months, left_on=[\"LocalCode\"], right_index=True, how=\"left\")\n","df_work = pd.merge(df_work, df_returns_3months, left_on=[\"LocalCode\"], right_index=True, how=\"left\")\n","\n","# 配当利回りを計算するために直近の終値を取得します\n","df_close = df_p_work.loc[df_p_work[\"Date\"] == df_p_work[\"Date\"].max(), [\"Code\", \"Date\", \"AdjustmentClose\"]]\n","# 直近の株価と結合します\n","df_work = pd.merge(df_work, df_close, left_on=[\"LocalCode\"], right_on=[\"Code\"], how=\"left\")\n","# 配当利回りを算出します\n","df_work[\"配当利回り\"] = df_work[\"ResultDividendPerShareFiscalYearEnd\"] / df_work[\"AdjustmentClose\"]\n","# 予想配当利回りを算出します\n","df_work[\"予想配当利回り\"] = df_work[\"ForecastDividendPerShareAnnual\"] / df_work[\"AdjustmentClose\"]\n","\n","# 配当性向を算出します\n","df_work[\"配当性向\"] = df_work[\"ResultDividendPerShareFiscalYearEnd\"] / df_work[\"EarningsPerShare\"] \n","# 予想配当性向を算出します\n","df_work[\"予想配当性向\"] = df_work[\"ForecastDividendPerShareAnnual\"] / df_work[\"ForecastEarningsPerShare\"]\n","\n","# 銘柄名と結合します\n","df_work = pd.merge(df_work, df_list, left_on=[\"LocalCode\"], right_on=[\"Code\"])\n","\n","# 表示用に開示日を追加します\n","df_work[\"開示日\"] = df_work[\"DisclosedDate\"].dt.strftime(\"%Y-%m-%d\")"]},{"cell_type":"code","execution_count":null,"metadata":{"id":"3jmgsVicS_tZ"},"outputs":[],"source":["# 表示する項目を指定します\n","output_cols = [\n"," \"LocalCode\",\n"," \"CompanyName\",\n"," \"開示日\",\n"," \"配当性向\",\n"," \"予想配当性向\",\n"," \"配当利回り\",\n"," \"予想配当利回り\",\n"," \"1ヶ月リターン\",\n"," \"3ヶ月リターン\",\n","]\n","# 項目別に表示方法を指定します\n","output_format = {\n"," \"配当性向\": \"{:.2%}\",\n"," \"予想配当性向\": \"{:.2%}\",\n"," \"配当利回り\": \"{:.2%}\",\n"," \"予想配当利回り\": \"{:.2%}\",\n"," \"1ヶ月リターン\": \"{:.2%}\",\n"," \"3ヶ月リターン\": \"{:.2%}\",\n","}"]},{"cell_type":"code","execution_count":null,"metadata":{"id":"X8rQDWRypNgr"},"outputs":[],"source":["# 配当利回り順に上位20銘柄を表示します\n","df_work.sort_values([\"配当利回り\"], ascending=False)[output_cols].head(20).style.format(output_format)"]},{"cell_type":"code","execution_count":null,"metadata":{"id":"-Dki6S63rzhz"},"outputs":[],"source":["# 予想配当利回り順に上位20銘柄を表示します\n","df_work.sort_values([\"予想配当利回り\"], ascending=False)[output_cols].head(20).style.format(output_format)"]},{"cell_type":"code","execution_count":null,"metadata":{"id":"FcI-7y7tpLG5"},"outputs":[],"source":["# 横軸に配当利回り、縦軸に1,3ヶ月リターンとして関係性をプロットします\n","display(\"1ヶ月リターン\")\n","sns.jointplot(x='配当利回り', y='1ヶ月リターン', data=df_work.loc[df_work[\"配当利回り\"] > 0.00], kind=\"reg\")\n","plt.show()\n","\n","display(\"3ヶ月リターン\")\n","sns.jointplot(x='配当利回り', y='3ヶ月リターン', data=df_work.loc[df_work[\"配当利回り\"] > 0.00], kind=\"reg\")\n","plt.show()"]},{"cell_type":"code","execution_count":null,"metadata":{"id":"iTJu84Hi5iZ3"},"outputs":[],"source":["# 横軸に予想配当利回り、縦軸に1,3,6ヶ月リターンとして関係性をプロットします\n","display(\"1ヶ月リターン\")\n","sns.jointplot(x='予想配当利回り', y='1ヶ月リターン', data=df_work.loc[df_work[\"予想配当利回り\"] > 0.00], kind=\"reg\")\n","plt.show()\n","\n","display(\"3ヶ月リターン\")\n","sns.jointplot(x='予想配当利回り', y='3ヶ月リターン', data=df_work.loc[df_work[\"予想配当利回り\"] > 0.00], kind=\"reg\")\n","plt.show()"]},{"cell_type":"code","execution_count":null,"metadata":{"id":"TiOy1x0fk40B"},"outputs":[],"source":["# 予想配当利回りが5%以上の銘柄とリターンの関係性をプロットします\n","display(\"1ヶ月リターン\")\n","sns.jointplot(x='予想配当利回り', y='1ヶ月リターン', data=df_work.loc[df_work[\"予想配当利回り\"] >= 0.05], kind=\"reg\")\n","plt.show()\n","\n","display(\"3ヶ月リターン\")\n","sns.jointplot(x='予想配当利回り', y='3ヶ月リターン', data=df_work.loc[df_work[\"予想配当利回り\"] >= 0.05], kind=\"reg\")\n","plt.show()"]},{"cell_type":"code","execution_count":null,"metadata":{"id":"jUJ68lwLxdSd"},"outputs":[],"source":[]}],"metadata":{"colab":{"authorship_tag":"ABX9TyOqKO9mZDov80L8FnzwcklK","collapsed_sections":[],"name":"20220825-003-dividend.ipynb","provenance":[]},"kernelspec":{"display_name":"Python 3","name":"python3"},"language_info":{"name":"python"}},"nbformat":4,"nbformat_minor":0}
+{"cells":[{"cell_type":"markdown","metadata":{"id":"OtR4VmnRshQX"},"source":["# 配当利回り\n","\n","[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/J-Quants/jquants-api-client-python/blob/master/examples/20220825-003-dividend.ipynb)\n","\n","\n","このノートブックでは J-Quants APIから取得できるデータから配当性向、配当利回り、および直近1,3ヶ月のリターンを一覧で表示します。\n","\n","\n","----\n","\n","**このノートブックはGoogle Driveを使用します。**\n","\n","- Google Drive の以下のファイルにリフレッシュトークンが書き込まれていることを想定しています。\n"," - `MyDrive/drive_ws/secret/jquantsapi-key.txt`\n","- Google Drive の以下のフォルダーにデータを書き込みます。\n"," - `MyDrive/drive_ws/marketdata`"]},{"cell_type":"code","execution_count":null,"metadata":{"id":"9REtVkPaGx7Y"},"outputs":[],"source":["# 必要なモジュールをインストールします。\n","! python -m pip install jquants-api-client japanize-matplotlib"]},{"cell_type":"code","execution_count":null,"metadata":{"id":"ilrdZjP4KknF"},"outputs":[],"source":["# Google drive をマウントします。\n","from google.colab import drive\n","drive.mount('/content/drive')"]},{"cell_type":"code","execution_count":null,"metadata":{"id":"A5fW3HxGN__3"},"outputs":[],"source":["import os\n","from datetime import datetime\n","\n","import japanize_matplotlib\n","import jquantsapi\n","import matplotlib.pyplot as plt\n","import numpy as np\n","import pandas as pd\n","import seaborn as sns"]},{"cell_type":"code","execution_count":null,"metadata":{"id":"3CeWabhlOGE4"},"outputs":[],"source":["# pandas の表示制限を調整します\n","pd.set_option(\"display.max_rows\", 1000)\n","pd.set_option(\"display.max_columns\", 1000)\n","pd.set_option(\"display.width\", 2000)"]},{"cell_type":"code","execution_count":null,"metadata":{"id":"8JRXB-JIQnDg"},"outputs":[],"source":["# プロット用の設定をします\n","sns.set(rc={'figure.figsize': (15, 10)})\n","sns.set(font_scale=1.5)\n","sns.set_style('whitegrid')\n","\n","japanize_matplotlib.japanize()"]},{"cell_type":"code","execution_count":null,"metadata":{"id":"fSG_cbO7Qm4x"},"outputs":[],"source":["# 一度取得したデータは Google Drive 上に保存して再利用します。\n","# 保存先ディレクトリを指定します。\n","STORAGE_DIR_PATH = \"/content/drive/MyDrive/drive_ws/marketdata\"\n","os.makedirs(STORAGE_DIR_PATH, exist_ok=True)\n","STORAGE_DIR_PATH"]},{"cell_type":"code","execution_count":null,"metadata":{"id":"fIRnvS9kOOqI"},"outputs":[],"source":["# J-Quants APIのトークンを保存してあるファイルを指定します\n","REFRESH_TOKEN_FILE_PATH = \"/content/drive/MyDrive/drive_ws/secret/jquantsapi-key.txt\""]},{"cell_type":"code","execution_count":null,"metadata":{"id":"dHm6w6O_QUnS"},"outputs":[],"source":["def get_refresh_token(refresh_token_file_path: str = REFRESH_TOKEN_FILE_PATH):\n"," with open(refresh_token_file_path, \"r\") as f:\n"," refresh_token = f.read()\n"," return refresh_token.rstrip().lstrip()"]},{"cell_type":"code","execution_count":null,"metadata":{"id":"9Ts2dfaRQV9C"},"outputs":[],"source":["# ファイルからリフレッシュトークンを読み込みます\n","refresh_token = get_refresh_token()"]},{"cell_type":"code","execution_count":null,"metadata":{"id":"7ZH_LuWUQYk8"},"outputs":[],"source":["# J-Quants APIクライアントを初期化します\n","jqapi = jquantsapi.Client(refresh_token=refresh_token)"]},{"cell_type":"code","execution_count":null,"metadata":{"id":"2KkfboPHsYd9"},"outputs":[],"source":["# 銘柄情報を取得します\n","now = pd.Timestamp.now(tz=\"Asia/Tokyo\")\n","\n","list_file = f\"{STORAGE_DIR_PATH}/list_{now.strftime('%Y%m%d')}.csv.gz\"\n","if not os.path.isfile(list_file):\n"," df_list = jqapi.get_list()\n"," df_list.to_csv(list_file, compression=\"gzip\", index=False)\n"," print(f\"save file: {list_file}\")\n","\n","# ファイルからデータを読み込みます\n","print(f\"file exists: {list_file}, loading\")\n","df_list = pd.read_csv(list_file, dtype=\"str\")"]},{"cell_type":"code","execution_count":null,"metadata":{"id":"xH2PYF0ENVYa"},"outputs":[],"source":["# 株価情報を取得します\n","now = pd.Timestamp.now(tz=\"Asia/Tokyo\")\n","# 過去3ヶ月のデータを取得\n","start_dt = now - pd.Timedelta(95, unit=\"D\")\n","end_dt = now\n","if end_dt.hour < 18:\n"," # データ更新時間前の場合は日付を1日ずらします。\n"," end_dt -= pd.Timedelta(1, unit=\"D\")\n","price_file = f\"{STORAGE_DIR_PATH}/price_{start_dt.strftime('%Y%m%d')}_{end_dt.strftime('%Y%m%d')}.csv.gz\"\n","if not os.path.isfile(price_file):\n"," df_p = jqapi.get_price_range(start_dt=start_dt, end_dt=end_dt)\n"," df_p.to_csv(price_file, compression=\"gzip\", index=False)\n"," df_p.reset_index(drop=True, inplace=True)\n"," print(f\"save file: {price_file}\")\n","\n","# データを読み込みます\n","print(f\"file exists: {price_file}, loading\")\n","df_p = pd.read_csv(price_file, dtype=\"str\")\n","df_p.reset_index(drop=True, inplace=True)\n","# 各列のデータ型を調整します\n","df_p.loc[:, \"Date\"] = pd.to_datetime(df_p[\"Date\"], format=\"%Y-%m-%d\")\n","df_p.loc[:, \"Open\"] = df_p[\"Open\"].astype(np.float64)\n","df_p.loc[:, \"High\"] = df_p[\"High\"].astype(np.float64)\n","df_p.loc[:, \"Low\"] = df_p[\"Low\"].astype(np.float64)\n","df_p.loc[:, \"Close\"] = df_p[\"Close\"].astype(np.float64)\n","df_p.loc[:, \"Volume\"] = df_p[\"Volume\"].astype(np.float64)\n","df_p.loc[:, \"TurnoverValue\"] = df_p[\"TurnoverValue\"].astype(np.float64)\n","df_p.loc[:, \"AdjustmentFactor\"] = df_p[\"AdjustmentFactor\"].astype(np.float64)\n","df_p.loc[:, \"AdjustmentOpen\"] = df_p[\"AdjustmentOpen\"].astype(np.float64)\n","df_p.loc[:, \"AdjustmentHigh\"] = df_p[\"AdjustmentHigh\"].astype(np.float64)\n","df_p.loc[:, \"AdjustmentLow\"] = df_p[\"AdjustmentLow\"].astype(np.float64)\n","df_p.loc[:, \"AdjustmentClose\"] = df_p[\"AdjustmentClose\"].astype(np.float64)\n","df_p.loc[:, \"AdjustmentVolume\"] = df_p[\"AdjustmentVolume\"].astype(np.float64)"]},{"cell_type":"code","execution_count":null,"metadata":{"id":"dzZL0Krs2gUe"},"outputs":[],"source":["# 過去3ヶ月に発表された財務情報を取得します\n","now = pd.Timestamp.now(tz=\"Asia/Tokyo\")\n","start_dt = now - pd.Timedelta(90, unit=\"D\")\n","end_dt = now\n","if end_dt.hour < 1:\n"," # データ更新時間前の場合は日付を1日ずらします。\n"," end_dt -= pd.Timedelta(1, unit=\"D\")\n","statements_file = f\"{STORAGE_DIR_PATH}/statements_{start_dt.strftime('%Y%m%d')}_{end_dt.strftime('%Y%m%d')}.csv.gz\"\n","if not os.path.isfile(statements_file):\n"," cache_dir = f\"{STORAGE_DIR_PATH}/raw_statements\"\n"," os.makedirs(cache_dir, exist_ok=True)\n"," df_s = jqapi.get_statements_range(\n"," start_dt=start_dt, end_dt=end_dt, cache_dir=cache_dir\n"," )\n"," df_s.to_csv(statements_file, compression=\"gzip\", index=False)\n"," print(f\"save file: {statements_file}\")\n","\n","print(f\"file exists: {statements_file}, loading\")\n","df_s = pd.read_csv(statements_file, dtype=\"str\")\n","# float64にするために\"-\"をnp.nanに置き換えます\n","df_s.replace({\"-\": np.nan}, inplace=True)\n","df_s[\"ResultDividendPerShareFiscalYearEnd\"] = df_s[\"ResultDividendPerShareFiscalYearEnd\"].astype(np.float64)\n","df_s[\"EarningsPerShare\"] = df_s[\"EarningsPerShare\"].astype(np.float64)\n","df_s[\"ForecastDividendPerShareAnnual\"] = df_s[\"ForecastDividendPerShareAnnual\"].astype(np.float64)\n","df_s[\"ForecastEarningsPerShare\"] = df_s[\"ForecastEarningsPerShare\"].astype(np.float64)\n","# 日付型に変換します\n","df_s.loc[:, \"DisclosedDate\"] = pd.to_datetime(\n"," df_s[\"DisclosedDate\"], format=\"%Y-%m-%d\"\n",")\n","df_s.loc[:, \"CurrentPeriodEndDate\"] = pd.to_datetime(\n"," df_s[\"CurrentPeriodEndDate\"], format=\"%Y-%m-%d\"\n",")\n","df_s.loc[:, \"CurrentFiscalYearStartDate\"] = pd.to_datetime(\n"," df_s[\"CurrentFiscalYearStartDate\"], format=\"%Y-%m-%d\"\n",")\n","df_s.loc[:, \"CurrentFiscalYearEndDate\"] = pd.to_datetime(\n"," df_s[\"CurrentFiscalYearEndDate\"], format=\"%Y-%m-%d\"\n",")\n","df_s.sort_values([\"DisclosedDate\", \"DisclosedTime\"], inplace=True)"]},{"cell_type":"code","execution_count":null,"metadata":{"id":"dtWhPh-_oMmt"},"outputs":[],"source":["# 作業用にデータをコピーします\n","df_work = df_s.copy()\n","df_p_work = df_p.copy()"]},{"cell_type":"code","execution_count":null,"metadata":{"id":"bkbOMxaIOSVc"},"outputs":[],"source":["# 財務情報を銘柄ごとに重複を排除して最新の財務情報のみを使用します\n","df_work.sort_values([\"DisclosedDate\", \"DisclosedTime\"], inplace=True)\n","df_work = df_work.drop_duplicates([\"LocalCode\"], keep=\"last\")\n","\n","# 終値が0の場合は前営業日の終値を使用します\n","df_p_work.sort_values([\"Code\", \"Date\"], inplace=True)\n","df_p_work[\"AdjustmentClose\"].replace({0.0: np.nan}, inplace=True)\n","df_p_work.loc[:, \"AdjustmentClose\"] = df_p_work.groupby(\"Code\")[\"AdjustmentClose\"].ffill()\n","# 終値がnanの場合は翌営業日の終値を使用します (データの先頭)\n","df_p_work.loc[:, \"AdjustmentClose\"] = df_p_work.groupby(\"Code\")[\"AdjustmentClose\"].bfill()\n","# 各銘柄の直近のリターンを算出します\n","def _calc_return(df, bdays):\n"," return (df[\"AdjustmentClose\"].iat[-1] / df[\"AdjustmentClose\"].iloc[-bdays:].iat[0]) - 1\n","df_p_work.sort_values([\"Code\", \"Date\"], inplace=True)\n","df_returns_1months = df_p_work.groupby(\"Code\").apply(_calc_return, 20).rename(\"1ヶ月リターン\")\n","df_returns_3months = df_p_work.groupby(\"Code\").apply(_calc_return, 60).rename(\"3ヶ月リターン\")\n","# リターンと結合します\n","df_work = pd.merge(df_work, df_returns_1months, left_on=[\"LocalCode\"], right_index=True, how=\"left\")\n","df_work = pd.merge(df_work, df_returns_3months, left_on=[\"LocalCode\"], right_index=True, how=\"left\")\n","\n","# 配当利回りを計算するために直近の終値を取得します\n","df_close = df_p_work.loc[df_p_work[\"Date\"] == df_p_work[\"Date\"].max(), [\"Code\", \"Date\", \"AdjustmentClose\"]]\n","# 直近の株価と結合します\n","df_work = pd.merge(df_work, df_close, left_on=[\"LocalCode\"], right_on=[\"Code\"], how=\"left\")\n","# 配当利回りを算出します\n","df_work[\"配当利回り\"] = df_work[\"ResultDividendPerShareFiscalYearEnd\"] / df_work[\"AdjustmentClose\"]\n","# 予想配当利回りを算出します\n","df_work[\"予想配当利回り\"] = df_work[\"ForecastDividendPerShareAnnual\"] / df_work[\"AdjustmentClose\"]\n","\n","# 配当性向を算出します\n","df_work[\"配当性向\"] = df_work[\"ResultDividendPerShareFiscalYearEnd\"] / df_work[\"EarningsPerShare\"] \n","# 予想配当性向を算出します\n","df_work[\"予想配当性向\"] = df_work[\"ForecastDividendPerShareAnnual\"] / df_work[\"ForecastEarningsPerShare\"]\n","\n","# 銘柄名と結合します\n","df_work = pd.merge(df_work, df_list, left_on=[\"LocalCode\"], right_on=[\"Code\"])\n","\n","# 表示用に開示日を追加します\n","df_work[\"開示日\"] = df_work[\"DisclosedDate\"].dt.strftime(\"%Y-%m-%d\")"]},{"cell_type":"code","execution_count":null,"metadata":{"id":"3jmgsVicS_tZ"},"outputs":[],"source":["# 表示する項目を指定します\n","output_cols = [\n"," \"LocalCode\",\n"," \"CompanyName\",\n"," \"開示日\",\n"," \"配当性向\",\n"," \"予想配当性向\",\n"," \"配当利回り\",\n"," \"予想配当利回り\",\n"," \"1ヶ月リターン\",\n"," \"3ヶ月リターン\",\n","]\n","# 項目別に表示方法を指定します\n","output_format = {\n"," \"配当性向\": \"{:.2%}\",\n"," \"予想配当性向\": \"{:.2%}\",\n"," \"配当利回り\": \"{:.2%}\",\n"," \"予想配当利回り\": \"{:.2%}\",\n"," \"1ヶ月リターン\": \"{:.2%}\",\n"," \"3ヶ月リターン\": \"{:.2%}\",\n","}"]},{"cell_type":"code","execution_count":null,"metadata":{"id":"X8rQDWRypNgr"},"outputs":[],"source":["# 配当利回り順に上位20銘柄を表示します\n","df_work.sort_values([\"配当利回り\"], ascending=False)[output_cols].head(20).style.format(output_format)"]},{"cell_type":"code","execution_count":null,"metadata":{"id":"-Dki6S63rzhz"},"outputs":[],"source":["# 予想配当利回り順に上位20銘柄を表示します\n","df_work.sort_values([\"予想配当利回り\"], ascending=False)[output_cols].head(20).style.format(output_format)"]},{"cell_type":"code","execution_count":null,"metadata":{"id":"FcI-7y7tpLG5"},"outputs":[],"source":["# 横軸に配当利回り、縦軸に1,3ヶ月リターンとして関係性をプロットします\n","display(\"1ヶ月リターン\")\n","sns.jointplot(x='配当利回り', y='1ヶ月リターン', data=df_work.loc[df_work[\"配当利回り\"] > 0.00], kind=\"reg\")\n","plt.show()\n","\n","display(\"3ヶ月リターン\")\n","sns.jointplot(x='配当利回り', y='3ヶ月リターン', data=df_work.loc[df_work[\"配当利回り\"] > 0.00], kind=\"reg\")\n","plt.show()"]},{"cell_type":"code","execution_count":null,"metadata":{"id":"iTJu84Hi5iZ3"},"outputs":[],"source":["# 横軸に予想配当利回り、縦軸に1,3,6ヶ月リターンとして関係性をプロットします\n","display(\"1ヶ月リターン\")\n","sns.jointplot(x='予想配当利回り', y='1ヶ月リターン', data=df_work.loc[df_work[\"予想配当利回り\"] > 0.00], kind=\"reg\")\n","plt.show()\n","\n","display(\"3ヶ月リターン\")\n","sns.jointplot(x='予想配当利回り', y='3ヶ月リターン', data=df_work.loc[df_work[\"予想配当利回り\"] > 0.00], kind=\"reg\")\n","plt.show()"]},{"cell_type":"code","execution_count":null,"metadata":{"id":"TiOy1x0fk40B"},"outputs":[],"source":["# 予想配当利回りが5%以上の銘柄とリターンの関係性をプロットします\n","display(\"1ヶ月リターン\")\n","sns.jointplot(x='予想配当利回り', y='1ヶ月リターン', data=df_work.loc[df_work[\"予想配当利回り\"] >= 0.05], kind=\"reg\")\n","plt.show()\n","\n","display(\"3ヶ月リターン\")\n","sns.jointplot(x='予想配当利回り', y='3ヶ月リターン', data=df_work.loc[df_work[\"予想配当利回り\"] >= 0.05], kind=\"reg\")\n","plt.show()"]},{"cell_type":"code","execution_count":null,"metadata":{"id":"jUJ68lwLxdSd"},"outputs":[],"source":[]}],"metadata":{"colab":{"authorship_tag":"ABX9TyOqKO9mZDov80L8FnzwcklK","collapsed_sections":[],"name":"20220825-003-dividend.ipynb","provenance":[]},"kernelspec":{"display_name":"Python 3","name":"python3"},"language_info":{"name":"python"}},"nbformat":4,"nbformat_minor":0}
diff --git a/examples/20220825-004-annual-dividend-history.ipynb b/examples/20220825-004-annual-dividend-history.ipynb
index 63ad13d..b4d5ee7 100644
--- a/examples/20220825-004-annual-dividend-history.ipynb
+++ b/examples/20220825-004-annual-dividend-history.ipynb
@@ -1 +1 @@
-{"cells":[{"cell_type":"markdown","metadata":{"id":"OtR4VmnRshQX"},"source":["# 年間配当額の推移\n","\n","[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/J-Quants/jquants-api-client-python/blob/master/examples/20220825-004-annual-dividend-history.ipynb)\n","\n","このノートブックでは J-Quants APIから取得できるデータを利用して特定銘柄についての年間配当額の推移を表示します。\n","\n","\n","----\n","\n","**このノートブックはGoogle Driveを使用します。**\n","\n","- Google Drive の以下のファイルにリフレッシュトークンが書き込まれていることを想定しています。\n"," - `MyDrive/drive_ws/secret/jquantsapi-key.txt`"]},{"cell_type":"code","execution_count":null,"metadata":{"id":"uFa-kSGyDhpY"},"outputs":[],"source":["# 年間配当額の推移を表示する銘柄コードを指定します (e.g. 8697)\n","TARGET_SYMBOL = \"8697\" # 日本取引所グループ"]},{"cell_type":"code","execution_count":null,"metadata":{"id":"9REtVkPaGx7Y"},"outputs":[],"source":["# 必要なモジュールをインストールします。\n","! python -m pip install jquants-api-client japanize-matplotlib mplfinance"]},{"cell_type":"code","execution_count":null,"metadata":{"id":"ilrdZjP4KknF"},"outputs":[],"source":["# Google drive をマウントします。\n","from google.colab import drive\n","drive.mount('/content/drive')"]},{"cell_type":"code","execution_count":null,"metadata":{"id":"A5fW3HxGN__3"},"outputs":[],"source":["import os\n","from datetime import datetime\n","\n","import japanize_matplotlib\n","import jquantsapi\n","import mplfinance as mpf\n","import matplotlib.pyplot as plt\n","import numpy as np\n","import pandas as pd\n","import seaborn as sns"]},{"cell_type":"code","execution_count":null,"metadata":{"id":"3CeWabhlOGE4"},"outputs":[],"source":["# pandas の表示制限を調整します\n","pd.set_option(\"display.max_rows\", 1000)\n","pd.set_option(\"display.max_columns\", 1000)\n","pd.set_option(\"display.width\", 2000)"]},{"cell_type":"code","execution_count":null,"metadata":{"id":"8JRXB-JIQnDg"},"outputs":[],"source":["# プロット用の設定をします\n","sns.set(rc={'figure.figsize': (15, 10)})\n","sns.set(font_scale=1.5)\n","sns.set_style('whitegrid')\n","\n","japanize_matplotlib.japanize()"]},{"cell_type":"code","execution_count":null,"metadata":{},"outputs":[],"source":["# 銘柄コードが4桁で指定されていた場合は末尾に0を付与します\n","if len(TARGET_SYMBOL) == 4:\n"," TARGET_SYMBOL += \"0\""]},{"cell_type":"code","execution_count":null,"metadata":{"id":"fIRnvS9kOOqI"},"outputs":[],"source":["# J-Quants APIのトークンを保存してあるファイルを指定します\n","REFRESH_TOKEN_FILE_PATH = \"/content/drive/MyDrive/drive_ws/secret/jquantsapi-key.txt\""]},{"cell_type":"code","execution_count":null,"metadata":{"id":"dHm6w6O_QUnS"},"outputs":[],"source":["def get_refresh_token(refresh_token_file_path: str = REFRESH_TOKEN_FILE_PATH):\n"," with open(refresh_token_file_path, \"r\") as f:\n"," refresh_token = f.read()\n"," return refresh_token.rstrip().lstrip()"]},{"cell_type":"code","execution_count":null,"metadata":{"id":"9Ts2dfaRQV9C"},"outputs":[],"source":["# ファイルからリフレッシュトークンを読み込みます\n","refresh_token = get_refresh_token()"]},{"cell_type":"code","execution_count":null,"metadata":{"id":"7ZH_LuWUQYk8"},"outputs":[],"source":["# J-Quants APIクライアントを初期化します\n","jqapi = jquantsapi.Client(refresh_token=refresh_token)"]},{"cell_type":"code","execution_count":null,"metadata":{"id":"2KkfboPHsYd9"},"outputs":[],"source":["# 銘柄情報を取得します\n","df_list = jqapi.get_list()"]},{"cell_type":"code","execution_count":null,"metadata":{},"outputs":[],"source":["# 対象銘柄の株価情報を取得します\n","df_p_org = jqapi.get_prices_daily_quotes(code=TARGET_SYMBOL)"]},{"cell_type":"code","execution_count":null,"metadata":{},"outputs":[],"source":["# 作業用にコピーします\n","df_p = df_p_org.copy()\n","\n","# 各列のデータ型を調整します\n","df_p.loc[:, \"Date\"] = pd.to_datetime(df_p[\"Date\"], format=\"%Y-%m-%d\")\n","df_p.loc[:, \"Open\"] = df_p[\"Open\"].astype(np.float64)\n","df_p.loc[:, \"High\"] = df_p[\"High\"].astype(np.float64)\n","df_p.loc[:, \"Low\"] = df_p[\"Low\"].astype(np.float64)\n","df_p.loc[:, \"Close\"] = df_p[\"Close\"].astype(np.float64)\n","df_p.loc[:, \"Volume\"] = df_p[\"Volume\"].astype(np.float64)\n","df_p.loc[:, \"TurnoverValue\"] = df_p[\"TurnoverValue\"].astype(np.float64)\n","df_p.loc[:, \"AdjustmentFactor\"] = df_p[\"AdjustmentFactor\"].astype(np.float64)\n","df_p.loc[:, \"AdjustmentOpen\"] = df_p[\"AdjustmentOpen\"].astype(np.float64)\n","df_p.loc[:, \"AdjustmentHigh\"] = df_p[\"AdjustmentHigh\"].astype(np.float64)\n","df_p.loc[:, \"AdjustmentLow\"] = df_p[\"AdjustmentLow\"].astype(np.float64)\n","df_p.loc[:, \"AdjustmentClose\"] = df_p[\"AdjustmentClose\"].astype(np.float64)\n","df_p.loc[:, \"AdjustmentVolume\"] = df_p[\"AdjustmentVolume\"].astype(np.float64)\n","# 株価が0のレコードを除外します\n","df_p = df_p.replace({0.0: np.nan}).dropna()\n","# 月足のOHLCVを作成します\n","df_p_m_ohlc = df_p.set_index(\"Date\")[[\n"," \"AdjustmentOpen\",\n"," \"AdjustmentHigh\",\n"," \"AdjustmentLow\",\n"," \"AdjustmentClose\",\n"," \"AdjustmentVolume\"\n","]].rename(columns={\n"," \"AdjustmentOpen\": \"Open\",\n"," \"AdjustmentHigh\": \"High\",\n"," \"AdjustmentLow\": \"Low\",\n"," \"AdjustmentClose\": \"Close\",\n"," \"AdjustmentVolume\": \"Volume\",\n","}).resample(\"M\").agg({\"Open\": \"first\", \"High\": \"max\", \"Low\": \"min\", \"Close\": \"last\", \"Volume\": \"sum\"})"]},{"cell_type":"code","execution_count":null,"metadata":{"id":"2lVEBIjaElfr"},"outputs":[],"source":["# 対象銘柄の財務情報を取得します\n","df_s_org = jqapi.get_fins_statements(code=TARGET_SYMBOL)"]},{"cell_type":"code","execution_count":null,"metadata":{"id":"kd9nlfs4GE6Y"},"outputs":[],"source":["# 作業用にコピーします\n","df_s = df_s_org.copy()\n","\n","# 年度末情報に絞り込みます\n","df_s = df_s.loc[df_s[\"TypeOfCurrentPeriod\"] == \"FY\"]\n","# float64にするために\"-\"および\"\"をnp.nanに置き換えます\n","df_s.replace({\"-\": np.nan, \"\": np.nan}, inplace=True)\n","df_s.loc[:, \"ResultDividendPerShareAnnual\"] = df_s[\"ResultDividendPerShareAnnual\"].astype(np.float64)\n","df_s.loc[:, \"ForecastDividendPerShareAnnual\"] = df_s[\"ForecastDividendPerShareAnnual\"].astype(np.float64)\n","df_s.loc[:, \"EarningsPerShare\"] = df_s[\"EarningsPerShare\"].astype(np.float64)\n","\n","# 日付型に変換します\n","df_s.loc[:, \"DisclosedDate\"] = pd.to_datetime(\n"," df_s[\"DisclosedDate\"], format=\"%Y-%m-%d\"\n",")\n","df_s.loc[:, \"CurrentPeriodEndDate\"] = pd.to_datetime(\n"," df_s[\"CurrentPeriodEndDate\"], format=\"%Y-%m-%d\"\n",")\n","df_s.loc[:, \"CurrentFiscalYearStartDate\"] = pd.to_datetime(\n"," df_s[\"CurrentFiscalYearStartDate\"], format=\"%Y-%m-%d\"\n",")\n","df_s.loc[:, \"CurrentFiscalYearEndDate\"] = pd.to_datetime(\n"," df_s[\"CurrentFiscalYearEndDate\"], format=\"%Y-%m-%d\"\n",")\n","# 開示順に並べ替えます\n","df_s.sort_values(\"DisclosedUnixTime\", inplace=True)\n","\n","# 配当性向を算出します\n","df_s[\"配当性向\"] = df_s[\"ResultDividendPerShareAnnual\"] / df_s[\"EarningsPerShare\"]"]},{"cell_type":"code","execution_count":null,"metadata":{"id":"Zn61xoi4H5cB"},"outputs":[],"source":["# プロット用に配当額が存在するレコードのみに絞り込みます\n","df_plot = df_s.loc[df_s[\"ResultDividendPerShareAnnual\"].notna()].set_index(\"DisclosedDate\")\n","# インデックスの表記を変更します\n","df_plot.index = df_plot.index.strftime(\"%Y-%m-%d\")\n","\n","# 項目名を日本語にします\n","df_plot.index.name = \"開示日\"\n","df_plot.rename(columns={\n"," \"ResultDividendPerShareAnnual\": \"配当実績_合計\",\n"," \"EarningsPerShare\": \"1株当たり当期純利益\",\n","}, inplace=True)\n","\n","# 配当額と1株あたり利益をプロットします\n","ax = df_plot[[\"配当実績_合計\", \"1株当たり当期純利益\"]].plot(kind=\"bar\")\n","# 配当性向をプロットします\n","bx = df_plot[[\"配当性向\"]].plot(linestyle='-', marker='o', ax=ax, use_index=False, secondary_y=True, color=\"black\")\n","\n","# 棒グラフに数字を表記します\n","for p in ax.patches:\n"," ax.annotate(str(p.get_height()), (p.get_x() * 1.005, p.get_height() * 1.005))\n","\n","# 銘柄名を取得します\n","name = df_list.loc[df_list[\"Code\"] == TARGET_SYMBOL, \"CompanyName\"].iat[0]\n","\n","# タイトルを設定します\n","ax.set_title(f\"{name}({TARGET_SYMBOL}) の年間配当推移\")"]},{"cell_type":"code","execution_count":null,"metadata":{"id":"0HlF2Zt1oOa5"},"outputs":[],"source":["# 株価の推移を月足で表示します\n","mpf.plot(df_p_m_ohlc, type=\"candle\", volume=True, figsize=(20, 8), vlines={\"vlines\": df_plot.index.tolist(), \"colors\": \"r\"})"]}],"metadata":{"colab":{"authorship_tag":"ABX9TyNWA57glz6LYpEP81RTb3Sf","collapsed_sections":[],"name":"20220825-004-annual-dividend-history.ipynb","provenance":[]},"kernelspec":{"display_name":"Python 3","name":"python3"},"language_info":{"name":"python"}},"nbformat":4,"nbformat_minor":0}
+{"cells":[{"cell_type":"markdown","metadata":{"id":"OtR4VmnRshQX"},"source":["# 年間配当額の推移\n","\n","[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/J-Quants/jquants-api-client-python/blob/master/examples/20220825-004-annual-dividend-history.ipynb)\n","\n","このノートブックでは J-Quants APIから取得できるデータを利用して特定銘柄についての年間配当額の推移を表示します。\n","\n","\n","----\n","\n","**このノートブックはGoogle Driveを使用します。**\n","\n","- Google Drive の以下のファイルにリフレッシュトークンが書き込まれていることを想定しています。\n"," - `MyDrive/drive_ws/secret/jquantsapi-key.txt`"]},{"cell_type":"code","execution_count":null,"metadata":{"id":"uFa-kSGyDhpY"},"outputs":[],"source":["# 年間配当額の推移を表示する銘柄コードを指定します (e.g. 8697)\n","TARGET_SYMBOL = \"8697\" # 日本取引所グループ"]},{"cell_type":"code","execution_count":null,"metadata":{"id":"9REtVkPaGx7Y"},"outputs":[],"source":["# 必要なモジュールをインストールします。\n","! python -m pip install jquants-api-client japanize-matplotlib mplfinance"]},{"cell_type":"code","execution_count":null,"metadata":{"id":"ilrdZjP4KknF"},"outputs":[],"source":["# Google drive をマウントします。\n","from google.colab import drive\n","drive.mount('/content/drive')"]},{"cell_type":"code","execution_count":null,"metadata":{"id":"A5fW3HxGN__3"},"outputs":[],"source":["import os\n","from datetime import datetime\n","\n","import japanize_matplotlib\n","import jquantsapi\n","import mplfinance as mpf\n","import matplotlib.pyplot as plt\n","import numpy as np\n","import pandas as pd\n","import seaborn as sns"]},{"cell_type":"code","execution_count":null,"metadata":{"id":"3CeWabhlOGE4"},"outputs":[],"source":["# pandas の表示制限を調整します\n","pd.set_option(\"display.max_rows\", 1000)\n","pd.set_option(\"display.max_columns\", 1000)\n","pd.set_option(\"display.width\", 2000)"]},{"cell_type":"code","execution_count":null,"metadata":{"id":"8JRXB-JIQnDg"},"outputs":[],"source":["# プロット用の設定をします\n","sns.set(rc={'figure.figsize': (15, 10)})\n","sns.set(font_scale=1.5)\n","sns.set_style('whitegrid')\n","\n","japanize_matplotlib.japanize()"]},{"cell_type":"code","execution_count":null,"metadata":{},"outputs":[],"source":["# 銘柄コードが4桁で指定されていた場合は末尾に0を付与します\n","if len(TARGET_SYMBOL) == 4:\n"," TARGET_SYMBOL += \"0\""]},{"cell_type":"code","execution_count":null,"metadata":{"id":"fIRnvS9kOOqI"},"outputs":[],"source":["# J-Quants APIのトークンを保存してあるファイルを指定します\n","REFRESH_TOKEN_FILE_PATH = \"/content/drive/MyDrive/drive_ws/secret/jquantsapi-key.txt\""]},{"cell_type":"code","execution_count":null,"metadata":{"id":"dHm6w6O_QUnS"},"outputs":[],"source":["def get_refresh_token(refresh_token_file_path: str = REFRESH_TOKEN_FILE_PATH):\n"," with open(refresh_token_file_path, \"r\") as f:\n"," refresh_token = f.read()\n"," return refresh_token.rstrip().lstrip()"]},{"cell_type":"code","execution_count":null,"metadata":{"id":"9Ts2dfaRQV9C"},"outputs":[],"source":["# ファイルからリフレッシュトークンを読み込みます\n","refresh_token = get_refresh_token()"]},{"cell_type":"code","execution_count":null,"metadata":{"id":"7ZH_LuWUQYk8"},"outputs":[],"source":["# J-Quants APIクライアントを初期化します\n","jqapi = jquantsapi.Client(refresh_token=refresh_token)"]},{"cell_type":"code","execution_count":null,"metadata":{"id":"2KkfboPHsYd9"},"outputs":[],"source":["# 銘柄情報を取得します\n","df_list = jqapi.get_list()"]},{"cell_type":"code","execution_count":null,"metadata":{},"outputs":[],"source":["# 対象銘柄の株価情報を取得します\n","df_p_org = jqapi.get_prices_daily_quotes(code=TARGET_SYMBOL)"]},{"cell_type":"code","execution_count":null,"metadata":{},"outputs":[],"source":["# 作業用にコピーします\n","df_p = df_p_org.copy()\n","\n","# 各列のデータ型を調整します\n","df_p.loc[:, \"Date\"] = pd.to_datetime(df_p[\"Date\"], format=\"%Y-%m-%d\")\n","df_p.loc[:, \"Open\"] = df_p[\"Open\"].astype(np.float64)\n","df_p.loc[:, \"High\"] = df_p[\"High\"].astype(np.float64)\n","df_p.loc[:, \"Low\"] = df_p[\"Low\"].astype(np.float64)\n","df_p.loc[:, \"Close\"] = df_p[\"Close\"].astype(np.float64)\n","df_p.loc[:, \"Volume\"] = df_p[\"Volume\"].astype(np.float64)\n","df_p.loc[:, \"TurnoverValue\"] = df_p[\"TurnoverValue\"].astype(np.float64)\n","df_p.loc[:, \"AdjustmentFactor\"] = df_p[\"AdjustmentFactor\"].astype(np.float64)\n","df_p.loc[:, \"AdjustmentOpen\"] = df_p[\"AdjustmentOpen\"].astype(np.float64)\n","df_p.loc[:, \"AdjustmentHigh\"] = df_p[\"AdjustmentHigh\"].astype(np.float64)\n","df_p.loc[:, \"AdjustmentLow\"] = df_p[\"AdjustmentLow\"].astype(np.float64)\n","df_p.loc[:, \"AdjustmentClose\"] = df_p[\"AdjustmentClose\"].astype(np.float64)\n","df_p.loc[:, \"AdjustmentVolume\"] = df_p[\"AdjustmentVolume\"].astype(np.float64)\n","# 株価が0のレコードを除外します\n","df_p = df_p.replace({0.0: np.nan}).dropna()\n","# 月足のOHLCVを作成します\n","df_p_m_ohlc = df_p.set_index(\"Date\")[[\n"," \"AdjustmentOpen\",\n"," \"AdjustmentHigh\",\n"," \"AdjustmentLow\",\n"," \"AdjustmentClose\",\n"," \"AdjustmentVolume\"\n","]].rename(columns={\n"," \"AdjustmentOpen\": \"Open\",\n"," \"AdjustmentHigh\": \"High\",\n"," \"AdjustmentLow\": \"Low\",\n"," \"AdjustmentClose\": \"Close\",\n"," \"AdjustmentVolume\": \"Volume\",\n","}).resample(\"M\").agg({\"Open\": \"first\", \"High\": \"max\", \"Low\": \"min\", \"Close\": \"last\", \"Volume\": \"sum\"})"]},{"cell_type":"code","execution_count":null,"metadata":{"id":"2lVEBIjaElfr"},"outputs":[],"source":["# 対象銘柄の財務情報を取得します\n","df_s_org = jqapi.get_fins_statements(code=TARGET_SYMBOL)"]},{"cell_type":"code","execution_count":null,"metadata":{"id":"kd9nlfs4GE6Y"},"outputs":[],"source":["# 作業用にコピーします\n","df_s = df_s_org.copy()\n","\n","# 年度末情報に絞り込みます\n","df_s = df_s.loc[df_s[\"TypeOfCurrentPeriod\"] == \"FY\"]\n","# float64にするために\"-\"および\"\"をnp.nanに置き換えます\n","df_s.replace({\"-\": np.nan, \"\": np.nan}, inplace=True)\n","df_s.loc[:, \"ResultDividendPerShareAnnual\"] = df_s[\"ResultDividendPerShareAnnual\"].astype(np.float64)\n","df_s.loc[:, \"ForecastDividendPerShareAnnual\"] = df_s[\"ForecastDividendPerShareAnnual\"].astype(np.float64)\n","df_s.loc[:, \"EarningsPerShare\"] = df_s[\"EarningsPerShare\"].astype(np.float64)\n","\n","# 日付型に変換します\n","df_s.loc[:, \"DisclosedDate\"] = pd.to_datetime(\n"," df_s[\"DisclosedDate\"], format=\"%Y-%m-%d\"\n",")\n","df_s.loc[:, \"CurrentPeriodEndDate\"] = pd.to_datetime(\n"," df_s[\"CurrentPeriodEndDate\"], format=\"%Y-%m-%d\"\n",")\n","df_s.loc[:, \"CurrentFiscalYearStartDate\"] = pd.to_datetime(\n"," df_s[\"CurrentFiscalYearStartDate\"], format=\"%Y-%m-%d\"\n",")\n","df_s.loc[:, \"CurrentFiscalYearEndDate\"] = pd.to_datetime(\n"," df_s[\"CurrentFiscalYearEndDate\"], format=\"%Y-%m-%d\"\n",")\n","# 開示順に並べ替えます\n","df_s.sort_values([\"DisclosedDate\", \"DisclosedTime\"], inplace=True)\n","\n","# 配当性向を算出します\n","df_s[\"配当性向\"] = df_s[\"ResultDividendPerShareAnnual\"] / df_s[\"EarningsPerShare\"]"]},{"cell_type":"code","execution_count":null,"metadata":{"id":"Zn61xoi4H5cB"},"outputs":[],"source":["# プロット用に配当額が存在するレコードのみに絞り込みます\n","df_plot = df_s.loc[df_s[\"ResultDividendPerShareAnnual\"].notna()].set_index(\"DisclosedDate\")\n","# インデックスの表記を変更します\n","df_plot.index = df_plot.index.strftime(\"%Y-%m-%d\")\n","\n","# 項目名を日本語にします\n","df_plot.index.name = \"開示日\"\n","df_plot.rename(columns={\n"," \"ResultDividendPerShareAnnual\": \"配当実績_合計\",\n"," \"EarningsPerShare\": \"1株当たり当期純利益\",\n","}, inplace=True)\n","\n","# 配当額と1株あたり利益をプロットします\n","ax = df_plot[[\"配当実績_合計\", \"1株当たり当期純利益\"]].plot(kind=\"bar\")\n","# 配当性向をプロットします\n","bx = df_plot[[\"配当性向\"]].plot(linestyle='-', marker='o', ax=ax, use_index=False, secondary_y=True, color=\"black\")\n","\n","# 棒グラフに数字を表記します\n","for p in ax.patches:\n"," ax.annotate(str(p.get_height()), (p.get_x() * 1.005, p.get_height() * 1.005))\n","\n","# 銘柄名を取得します\n","name = df_list.loc[df_list[\"Code\"] == TARGET_SYMBOL, \"CompanyName\"].iat[0]\n","\n","# タイトルを設定します\n","ax.set_title(f\"{name}({TARGET_SYMBOL}) の年間配当推移\")"]},{"cell_type":"code","execution_count":null,"metadata":{"id":"0HlF2Zt1oOa5"},"outputs":[],"source":["# 株価の推移を月足で表示します\n","df_s[\"DisclosedDate\"] = pd.to_datetime(df_s[\"DisclosedDate\"])\n","df_plot = df_s.loc[df_s[\"ResultDividendPerShareAnnual\"].notna()].set_index(\"DisclosedDate\")\n","\n","mpf.plot(\n"," df_p_m_ohlc,\n"," type=\"candle\",\n"," volume=True,\n"," figsize=(20, 8),\n"," vlines={\"vlines\": df_plot.index[df_plot.index > df_p_m_ohlc.index[0]].tolist(), \"colors\": \"r\"}\n",")"]}],"metadata":{"colab":{"authorship_tag":"ABX9TyNWA57glz6LYpEP81RTb3Sf","collapsed_sections":[],"name":"20220825-004-annual-dividend-history.ipynb","provenance":[]},"kernelspec":{"display_name":"Python 3","name":"python3"},"language_info":{"name":"python"}},"nbformat":4,"nbformat_minor":0}
diff --git a/examples/20220927-005-jquants-api-starter.ipynb b/examples/20220927-005-jquants-api-starter.ipynb
index 78b3285..6e0c907 100644
--- a/examples/20220927-005-jquants-api-starter.ipynb
+++ b/examples/20220927-005-jquants-api-starter.ipynb
@@ -3,16 +3,7 @@
"nbformat_minor": 0,
"metadata": {
"colab": {
- "provenance": [],
- "collapsed_sections": [
- "ZOgNFJtEY1g9",
- "in1t1GGTXHx7",
- "IOurY_o-Y9Cl",
- "9Ox2YvyjY_p8",
- "tnIOKgSdX0GV",
- "nXzXQx-LQNP4"
- ],
- "toc_visible": true
+ "provenance": []
},
"kernelspec": {
"name": "python3",
@@ -66,59 +57,43 @@
"source": [
"\n",
"\n",
- "1. [APIサービス登録ページ](https://application.jpx-jquants.com/register)よりJ-Quants APIサービスへ登録\n",
+ "1. [APIサービス登録ページ](https://jpx-jquants.com/auth/signup)よりJ-Quants APIサービスへ登録\n",
"\n",
- "2. 登録後、[ログインページ](https://application.jpx-jquants.com/)から登録したメールアドレス及びパスワードでJ-Quants APIサービスへログインしリフレッシュトークンを取得(取得ボタンを押下すると、自動的にクリップボードへコピーされます)\n",
+ "2. 登録後、[ログインページ](https://jpx-jquants.com/auth/signin)から登録したメールアドレス及びパスワードでJ-Quants APIサービスへログインしリフレッシュトークンを取得(取得ボタンを押下すると、自動的にクリップボードへコピーされます)\n",
"3. CurlコマンドやPython等を用いて、リフレッシュトークンを利用し、ID tokenを取得\n",
"4. CurlコマンドやPython等を用いて、取得したID tokenを利用し、データを取得\n",
"\n",
- "なお、J-Quants APIの各種APIの仕様は[こちら](https://jpx.gitbook.io/j-quants-api/api-reference)をご参照ください。"
+ "なお、J-Quants APIの各種APIの仕様は[こちら](https://jpx.gitbook.io/j-quants-ja/api-reference)をご参照ください。"
],
"metadata": {
"id": "wWXM0pB9WQuu"
}
},
- {
- "cell_type": "markdown",
- "source": [
- "### 上記3. について、pythonによるID token取得サンプル"
- ],
- "metadata": {
- "id": "RJ3T_ryoWvHd"
- }
- },
{
"cell_type": "code",
"source": [
+ "#@title 上記3. について、pythonによるID token取得サンプル\n",
"import requests\n",
"import json\n",
"\n",
"REFRESH_TOKEN = \"こちらにクリップボードにコピーしたリフレッシュトークンを貼り付け\"\n",
"idToken = requests.post(\n",
- " f\"https://api.jpx-jquants.com/v1/token/auth_refresh?refreshtoken={REFRESH_TOKEN}\"\n",
+ " f\"https://api.jquants.com/v1/token/auth_refresh?refreshtoken={REFRESH_TOKEN}\"\n",
").json()[\"idToken\"]\n"
],
"metadata": {
"id": "dZQEHU8rfatx"
},
- "execution_count": 1,
+ "execution_count": null,
"outputs": []
},
- {
- "cell_type": "markdown",
- "source": [
- "### 上記4.について、 pythonによるデータ取得サンプル(銘柄情報)"
- ],
- "metadata": {
- "id": "tWSh0UrwgVCe"
- }
- },
{
"cell_type": "code",
"source": [
+ "#@title 上記4.について、 pythonによるデータ取得サンプル(銘柄情報)\n",
"# 上記3.idTokenを取得していることが前提です\n",
"headers = {'Authorization': 'Bearer {}'.format(idToken)}\n",
- "r = requests.get(\"https://api.jpx-jquants.com/v1/listed/info\", headers=headers)\n",
+ "r = requests.get(\"https://api.jquants.com/v1/listed/info\", headers=headers)\n",
"\n",
"# APIからのresponseはjson形式\n",
"info_data = r.json()[\"info\"]\n",
@@ -127,74 +102,10 @@
"info_data[:5]\n"
],
"metadata": {
- "id": "kv7PjrZRgcK2",
- "colab": {
- "base_uri": "https://localhost:8080/"
- },
- "outputId": "e4ed37cf-4a4b-4467-df50-adfabb55699d"
+ "id": "kv7PjrZRgcK2"
},
- "execution_count": 2,
- "outputs": [
- {
- "output_type": "execute_result",
- "data": {
- "text/plain": [
- "[{'Date': '20221125',\n",
- " 'Code': '13010',\n",
- " 'CompanyName': '極洋',\n",
- " 'Sector17Code': '1',\n",
- " 'Sector17CodeName': '食品',\n",
- " 'Sector33Code': '0050',\n",
- " 'Sector33CodeName': '水産・農林業',\n",
- " 'ScaleCategory': 'TOPIX Small 2',\n",
- " 'MarketCode': '111',\n",
- " 'MarketCodeName': 'プライム'},\n",
- " {'Date': '20221125',\n",
- " 'Code': '13050',\n",
- " 'CompanyName': 'ダイワ上場投信−トピックス',\n",
- " 'Sector17Code': '99',\n",
- " 'Sector17CodeName': 'その他',\n",
- " 'Sector33Code': '9999',\n",
- " 'Sector33CodeName': 'その他',\n",
- " 'ScaleCategory': '-',\n",
- " 'MarketCode': '109',\n",
- " 'MarketCodeName': 'その他'},\n",
- " {'Date': '20221125',\n",
- " 'Code': '13060',\n",
- " 'CompanyName': 'NEXTFUNDSTOPIX連動型上場投信',\n",
- " 'Sector17Code': '99',\n",
- " 'Sector17CodeName': 'その他',\n",
- " 'Sector33Code': '9999',\n",
- " 'Sector33CodeName': 'その他',\n",
- " 'ScaleCategory': '-',\n",
- " 'MarketCode': '109',\n",
- " 'MarketCodeName': 'その他'},\n",
- " {'Date': '20221125',\n",
- " 'Code': '13080',\n",
- " 'CompanyName': '上場インデックスファンドTOPIX',\n",
- " 'Sector17Code': '99',\n",
- " 'Sector17CodeName': 'その他',\n",
- " 'Sector33Code': '9999',\n",
- " 'Sector33CodeName': 'その他',\n",
- " 'ScaleCategory': '-',\n",
- " 'MarketCode': '109',\n",
- " 'MarketCodeName': 'その他'},\n",
- " {'Date': '20221125',\n",
- " 'Code': '13090',\n",
- " 'CompanyName': 'NEXTFUNDSChinaAMC・中国株式・上証50連動型上場投信',\n",
- " 'Sector17Code': '99',\n",
- " 'Sector17CodeName': 'その他',\n",
- " 'Sector33Code': '9999',\n",
- " 'Sector33CodeName': 'その他',\n",
- " 'ScaleCategory': '-',\n",
- " 'MarketCode': '109',\n",
- " 'MarketCodeName': 'その他'}]"
- ]
- },
- "metadata": {},
- "execution_count": 2
- }
- ]
+ "execution_count": null,
+ "outputs": []
},
{
"cell_type": "markdown",
@@ -213,11 +124,9 @@
"\n",
"\n",
"\n",
- "* Python用クライアントライブラリ( [jquants-api-client-python](https://github.com/J-Quants/jquants-api-client-python) )\n",
- "\n",
- "* R用クライアントライブラリ( [JQuantsR](https://github.com/J-Quants/JQuantsR) )\n",
+ "* Python用クライアントライブラリ( [jquants-api-client-python](https://github.com/J-Quants/jquants-api-client-python) ) (有償版対応済)\n",
"\n",
- "* Julia用クライアントライブラリ( [JQuants.jl](https://github.com/ki-chi/JQuants.jl) )\n",
+ "* R用クライアントライブラリ( [JQuantsR](https://github.com/J-Quants/JQuantsR) ) (有償版対応済)\n",
"\n",
"今回はPythonを用いるため、Python用クライアントライブラリを利用します。"
],
@@ -232,38 +141,10 @@
"!pip install jquants-api-client\n"
],
"metadata": {
- "colab": {
- "base_uri": "https://localhost:8080/"
- },
- "id": "h-WxFL-coL4K",
- "outputId": "0154d851-c427-4087-fed7-95efa290472e"
+ "id": "h-WxFL-coL4K"
},
- "execution_count": 3,
- "outputs": [
- {
- "output_type": "stream",
- "name": "stdout",
- "text": [
- "Looking in indexes: https://pypi.org/simple, https://us-python.pkg.dev/colab-wheels/public/simple/\n",
- "Requirement already satisfied: jquants-api-client in /usr/local/lib/python3.7/dist-packages (0.2.0)\n",
- "Requirement already satisfied: types-requests<3.0.0,>=2.28.5 in /usr/local/lib/python3.7/dist-packages (from jquants-api-client) (2.28.11.5)\n",
- "Requirement already satisfied: tomli<3.0.0,>=2.0.1 in /usr/local/lib/python3.7/dist-packages (from jquants-api-client) (2.0.1)\n",
- "Requirement already satisfied: types-python-dateutil<3.0.0,>=2.8.19 in /usr/local/lib/python3.7/dist-packages (from jquants-api-client) (2.8.19.4)\n",
- "Requirement already satisfied: numpy<1.22.0,>=1.21.6 in /usr/local/lib/python3.7/dist-packages (from jquants-api-client) (1.21.6)\n",
- "Requirement already satisfied: requests<3.0.0,>=2.23.0 in /usr/local/lib/python3.7/dist-packages (from jquants-api-client) (2.23.0)\n",
- "Requirement already satisfied: tenacity<9.0.0,>=8.0.1 in /usr/local/lib/python3.7/dist-packages (from jquants-api-client) (8.1.0)\n",
- "Requirement already satisfied: pandas<1.4.0,>=1.3.5 in /usr/local/lib/python3.7/dist-packages (from jquants-api-client) (1.3.5)\n",
- "Requirement already satisfied: urllib3<2.0.0,>=1.24.3 in /usr/local/lib/python3.7/dist-packages (from jquants-api-client) (1.24.3)\n",
- "Requirement already satisfied: pytz>=2017.3 in /usr/local/lib/python3.7/dist-packages (from pandas<1.4.0,>=1.3.5->jquants-api-client) (2022.6)\n",
- "Requirement already satisfied: python-dateutil>=2.7.3 in /usr/local/lib/python3.7/dist-packages (from pandas<1.4.0,>=1.3.5->jquants-api-client) (2.8.2)\n",
- "Requirement already satisfied: six>=1.5 in /usr/local/lib/python3.7/dist-packages (from python-dateutil>=2.7.3->pandas<1.4.0,>=1.3.5->jquants-api-client) (1.15.0)\n",
- "Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.7/dist-packages (from requests<3.0.0,>=2.23.0->jquants-api-client) (2022.9.24)\n",
- "Requirement already satisfied: idna<3,>=2.5 in /usr/local/lib/python3.7/dist-packages (from requests<3.0.0,>=2.23.0->jquants-api-client) (2.10)\n",
- "Requirement already satisfied: chardet<4,>=3.0.2 in /usr/local/lib/python3.7/dist-packages (from requests<3.0.0,>=2.23.0->jquants-api-client) (3.0.4)\n",
- "Requirement already satisfied: types-urllib3<1.27 in /usr/local/lib/python3.7/dist-packages (from types-requests<3.0.0,>=2.28.5->jquants-api-client) (1.26.25.4)\n"
- ]
- }
- ]
+ "execution_count": null,
+ "outputs": []
},
{
"cell_type": "code",
@@ -273,22 +154,10 @@
"drive.mount('/content/drive')\n"
],
"metadata": {
- "colab": {
- "base_uri": "https://localhost:8080/"
- },
- "id": "T8W0O5yFWT5f",
- "outputId": "b2e9f312-ba20-474f-e214-2e75e817312d"
+ "id": "T8W0O5yFWT5f"
},
- "execution_count": 4,
- "outputs": [
- {
- "output_type": "stream",
- "name": "stdout",
- "text": [
- "Drive already mounted at /content/drive; to attempt to forcibly remount, call drive.mount(\"/content/drive\", force_remount=True).\n"
- ]
- }
- ]
+ "execution_count": null,
+ "outputs": []
},
{
"cell_type": "markdown",
@@ -310,13 +179,17 @@
"import plotly.express as px\n",
"import plotly.graph_objects as go\n",
"from plotly.subplots import make_subplots\n",
+ "from datetime import datetime, timedelta\n",
+ "import warnings\n",
"\n",
"import jquantsapi\n",
"\n",
"# pandasデータフレームの描画設定\n",
- "pd.set_option(\"max_columns\", None)\n",
- "pd.set_option(\"max_rows\", 40)\n",
- "pd.set_option(\"max_colwidth\", 80)\n",
+ "pd.set_option(\"display.max_columns\", None)\n",
+ "pd.set_option(\"display.max_rows\", 40)\n",
+ "pd.set_option(\"display.max_colwidth\", 80)\n",
+ "\n",
+ "warnings.simplefilter('ignore')\n",
"\n",
"# 今回はID及びPWは上記に記載の方法により別ファイルに保存しているため、引数特になしでOK。\n",
"cli = jquantsapi.Client()\n",
@@ -327,7 +200,7 @@
"metadata": {
"id": "HCJbxQLxoYWB"
},
- "execution_count": 5,
+ "execution_count": null,
"outputs": []
},
{
@@ -337,324 +210,10 @@
"cli.get_listed_info()"
],
"metadata": {
- "colab": {
- "base_uri": "https://localhost:8080/",
- "height": 0
- },
- "id": "aoraqfriWfws",
- "outputId": "60aea904-9d50-4c91-b53d-96285a4b6d93"
+ "id": "aoraqfriWfws"
},
- "execution_count": 6,
- "outputs": [
- {
- "output_type": "execute_result",
- "data": {
- "text/plain": [
- " Date Code CompanyName Sector17Code \\\n",
- "0 2022-11-25 13010 極洋 1 \n",
- "1 2022-11-25 13050 ダイワ上場投信−トピックス 99 \n",
- "2 2022-11-25 13060 NEXTFUNDSTOPIX連動型上場投信 99 \n",
- "3 2022-11-25 13080 上場インデックスファンドTOPIX 99 \n",
- "4 2022-11-25 13090 NEXTFUNDSChinaAMC・中国株式・上証50連動型上場投信 99 \n",
- "... ... ... ... ... \n",
- "4221 2022-11-25 99930 ヤマザワ 14 \n",
- "4222 2022-11-25 99940 やまや 14 \n",
- "4223 2022-11-25 99950 グローセル 13 \n",
- "4224 2022-11-25 99960 サトー商会 13 \n",
- "4225 2022-11-25 99970 ベルーナ 14 \n",
- "\n",
- " Sector17CodeName Sector33Code Sector33CodeName ScaleCategory MarketCode \\\n",
- "0 食品 0050 水産・農林業 TOPIX Small 2 111 \n",
- "1 その他 9999 その他 - 109 \n",
- "2 その他 9999 その他 - 109 \n",
- "3 その他 9999 その他 - 109 \n",
- "4 その他 9999 その他 - 109 \n",
- "... ... ... ... ... ... \n",
- "4221 小売 6100 小売業 TOPIX Small 2 112 \n",
- "4222 小売 6100 小売業 TOPIX Small 2 112 \n",
- "4223 商社・卸売 6050 卸売業 TOPIX Small 2 111 \n",
- "4224 商社・卸売 6050 卸売業 - 112 \n",
- "4225 小売 6100 小売業 TOPIX Small 1 111 \n",
- "\n",
- " MarketCodeName \n",
- "0 プライム \n",
- "1 その他 \n",
- "2 その他 \n",
- "3 その他 \n",
- "4 その他 \n",
- "... ... \n",
- "4221 スタンダード \n",
- "4222 スタンダード \n",
- "4223 プライム \n",
- "4224 スタンダード \n",
- "4225 プライム \n",
- "\n",
- "[4226 rows x 10 columns]"
- ],
- "text/html": [
- "\n",
- "
\n",
- "
\n",
- "
\n",
- "\n",
- "
\n",
- " \n",
- " \n",
- " \n",
- " Date \n",
- " Code \n",
- " CompanyName \n",
- " Sector17Code \n",
- " Sector17CodeName \n",
- " Sector33Code \n",
- " Sector33CodeName \n",
- " ScaleCategory \n",
- " MarketCode \n",
- " MarketCodeName \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " 0 \n",
- " 2022-11-25 \n",
- " 13010 \n",
- " 極洋 \n",
- " 1 \n",
- " 食品 \n",
- " 0050 \n",
- " 水産・農林業 \n",
- " TOPIX Small 2 \n",
- " 111 \n",
- " プライム \n",
- " \n",
- " \n",
- " 1 \n",
- " 2022-11-25 \n",
- " 13050 \n",
- " ダイワ上場投信−トピックス \n",
- " 99 \n",
- " その他 \n",
- " 9999 \n",
- " その他 \n",
- " - \n",
- " 109 \n",
- " その他 \n",
- " \n",
- " \n",
- " 2 \n",
- " 2022-11-25 \n",
- " 13060 \n",
- " NEXTFUNDSTOPIX連動型上場投信 \n",
- " 99 \n",
- " その他 \n",
- " 9999 \n",
- " その他 \n",
- " - \n",
- " 109 \n",
- " その他 \n",
- " \n",
- " \n",
- " 3 \n",
- " 2022-11-25 \n",
- " 13080 \n",
- " 上場インデックスファンドTOPIX \n",
- " 99 \n",
- " その他 \n",
- " 9999 \n",
- " その他 \n",
- " - \n",
- " 109 \n",
- " その他 \n",
- " \n",
- " \n",
- " 4 \n",
- " 2022-11-25 \n",
- " 13090 \n",
- " NEXTFUNDSChinaAMC・中国株式・上証50連動型上場投信 \n",
- " 99 \n",
- " その他 \n",
- " 9999 \n",
- " その他 \n",
- " - \n",
- " 109 \n",
- " その他 \n",
- " \n",
- " \n",
- " ... \n",
- " ... \n",
- " ... \n",
- " ... \n",
- " ... \n",
- " ... \n",
- " ... \n",
- " ... \n",
- " ... \n",
- " ... \n",
- " ... \n",
- " \n",
- " \n",
- " 4221 \n",
- " 2022-11-25 \n",
- " 99930 \n",
- " ヤマザワ \n",
- " 14 \n",
- " 小売 \n",
- " 6100 \n",
- " 小売業 \n",
- " TOPIX Small 2 \n",
- " 112 \n",
- " スタンダード \n",
- " \n",
- " \n",
- " 4222 \n",
- " 2022-11-25 \n",
- " 99940 \n",
- " やまや \n",
- " 14 \n",
- " 小売 \n",
- " 6100 \n",
- " 小売業 \n",
- " TOPIX Small 2 \n",
- " 112 \n",
- " スタンダード \n",
- " \n",
- " \n",
- " 4223 \n",
- " 2022-11-25 \n",
- " 99950 \n",
- " グローセル \n",
- " 13 \n",
- " 商社・卸売 \n",
- " 6050 \n",
- " 卸売業 \n",
- " TOPIX Small 2 \n",
- " 111 \n",
- " プライム \n",
- " \n",
- " \n",
- " 4224 \n",
- " 2022-11-25 \n",
- " 99960 \n",
- " サトー商会 \n",
- " 13 \n",
- " 商社・卸売 \n",
- " 6050 \n",
- " 卸売業 \n",
- " - \n",
- " 112 \n",
- " スタンダード \n",
- " \n",
- " \n",
- " 4225 \n",
- " 2022-11-25 \n",
- " 99970 \n",
- " ベルーナ \n",
- " 14 \n",
- " 小売 \n",
- " 6100 \n",
- " 小売業 \n",
- " TOPIX Small 1 \n",
- " 111 \n",
- " プライム \n",
- " \n",
- " \n",
- "
\n",
- "
4226 rows × 10 columns
\n",
- "
\n",
- "
\n",
- " \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " \n",
- "\n",
- " \n",
- "
\n",
- "
\n",
- " "
- ]
- },
- "metadata": {},
- "execution_count": 6
- }
- ]
+ "execution_count": null,
+ "outputs": []
},
{
"cell_type": "markdown",
@@ -669,36 +228,13 @@
"cell_type": "markdown",
"source": [
"# 銘柄一覧情報 API(毎営業日の21時頃データ更新)\n",
- "(注)2022/11/25時点の情報です。\n",
"\n",
- "銘柄情報は、東京証券取引所へ上場している銘柄について、2017年1月から直近及び翌営業日までの期間を提供しています。"
+ "銘柄情報は、東京証券取引所へ上場している銘柄について提供しています。"
],
"metadata": {
"id": "in1t1GGTXHx7"
}
},
- {
- "cell_type": "markdown",
- "source": [
- "## API出力データ概要\n",
- "\n",
- "|変数名|概要|\n",
- "|---|---|\n",
- "|Date|銘柄情報適用年月日|\n",
- "|Code|株式銘柄コード(5桁表示)|\n",
- "|CompanyName|企業名略称|\n",
- "|Sector17Code|17業種コード|\n",
- "|Sector17CodeName|17業種コード名|\n",
- "|Sector33Code|33業種コード|\n",
- "|Sector33CodeName|33業種コード名|\n",
- "|ScaleCategory|規模コード|\n",
- "|MarketCode|市場区分コード|\n",
- "|MarketCodeName|市場区分名|"
- ],
- "metadata": {
- "id": "feQ0V2J5ZFHr"
- }
- },
{
"cell_type": "code",
"source": [
@@ -713,349 +249,10 @@
"df_info\n"
],
"metadata": {
- "colab": {
- "base_uri": "https://localhost:8080/",
- "height": 0
- },
- "id": "UF2xMSqimuPw",
- "outputId": "23e02519-d88d-4c13-8052-b5bfa0fada1c"
+ "id": "UF2xMSqimuPw"
},
- "execution_count": 7,
- "outputs": [
- {
- "output_type": "stream",
- "name": "stdout",
- "text": [
- "\n",
- "Int64Index: 4226 entries, 0 to 4225\n",
- "Data columns (total 10 columns):\n",
- " # Column Non-Null Count Dtype \n",
- "--- ------ -------------- ----- \n",
- " 0 Date 4226 non-null datetime64[ns]\n",
- " 1 Code 4226 non-null object \n",
- " 2 CompanyName 4226 non-null object \n",
- " 3 Sector17Code 4226 non-null object \n",
- " 4 Sector17CodeName 4226 non-null object \n",
- " 5 Sector33Code 4226 non-null object \n",
- " 6 Sector33CodeName 4226 non-null object \n",
- " 7 ScaleCategory 4226 non-null object \n",
- " 8 MarketCode 4226 non-null object \n",
- " 9 MarketCodeName 4226 non-null object \n",
- "dtypes: datetime64[ns](1), object(9)\n",
- "memory usage: 363.2+ KB\n",
- "\n",
- "\n"
- ]
- },
- {
- "output_type": "execute_result",
- "data": {
- "text/plain": [
- " Date Code CompanyName Sector17Code \\\n",
- "0 2022-11-25 13010 極洋 1 \n",
- "1 2022-11-25 13050 ダイワ上場投信−トピックス 99 \n",
- "2 2022-11-25 13060 NEXTFUNDSTOPIX連動型上場投信 99 \n",
- "3 2022-11-25 13080 上場インデックスファンドTOPIX 99 \n",
- "4 2022-11-25 13090 NEXTFUNDSChinaAMC・中国株式・上証50連動型上場投信 99 \n",
- "... ... ... ... ... \n",
- "4221 2022-11-25 99930 ヤマザワ 14 \n",
- "4222 2022-11-25 99940 やまや 14 \n",
- "4223 2022-11-25 99950 グローセル 13 \n",
- "4224 2022-11-25 99960 サトー商会 13 \n",
- "4225 2022-11-25 99970 ベルーナ 14 \n",
- "\n",
- " Sector17CodeName Sector33Code Sector33CodeName ScaleCategory MarketCode \\\n",
- "0 食品 0050 水産・農林業 TOPIX Small 2 111 \n",
- "1 その他 9999 その他 - 109 \n",
- "2 その他 9999 その他 - 109 \n",
- "3 その他 9999 その他 - 109 \n",
- "4 その他 9999 その他 - 109 \n",
- "... ... ... ... ... ... \n",
- "4221 小売 6100 小売業 TOPIX Small 2 112 \n",
- "4222 小売 6100 小売業 TOPIX Small 2 112 \n",
- "4223 商社・卸売 6050 卸売業 TOPIX Small 2 111 \n",
- "4224 商社・卸売 6050 卸売業 - 112 \n",
- "4225 小売 6100 小売業 TOPIX Small 1 111 \n",
- "\n",
- " MarketCodeName \n",
- "0 プライム \n",
- "1 その他 \n",
- "2 その他 \n",
- "3 その他 \n",
- "4 その他 \n",
- "... ... \n",
- "4221 スタンダード \n",
- "4222 スタンダード \n",
- "4223 プライム \n",
- "4224 スタンダード \n",
- "4225 プライム \n",
- "\n",
- "[4226 rows x 10 columns]"
- ],
- "text/html": [
- "\n",
- " \n",
- "
\n",
- "
\n",
- "\n",
- "
\n",
- " \n",
- " \n",
- " \n",
- " Date \n",
- " Code \n",
- " CompanyName \n",
- " Sector17Code \n",
- " Sector17CodeName \n",
- " Sector33Code \n",
- " Sector33CodeName \n",
- " ScaleCategory \n",
- " MarketCode \n",
- " MarketCodeName \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " 0 \n",
- " 2022-11-25 \n",
- " 13010 \n",
- " 極洋 \n",
- " 1 \n",
- " 食品 \n",
- " 0050 \n",
- " 水産・農林業 \n",
- " TOPIX Small 2 \n",
- " 111 \n",
- " プライム \n",
- " \n",
- " \n",
- " 1 \n",
- " 2022-11-25 \n",
- " 13050 \n",
- " ダイワ上場投信−トピックス \n",
- " 99 \n",
- " その他 \n",
- " 9999 \n",
- " その他 \n",
- " - \n",
- " 109 \n",
- " その他 \n",
- " \n",
- " \n",
- " 2 \n",
- " 2022-11-25 \n",
- " 13060 \n",
- " NEXTFUNDSTOPIX連動型上場投信 \n",
- " 99 \n",
- " その他 \n",
- " 9999 \n",
- " その他 \n",
- " - \n",
- " 109 \n",
- " その他 \n",
- " \n",
- " \n",
- " 3 \n",
- " 2022-11-25 \n",
- " 13080 \n",
- " 上場インデックスファンドTOPIX \n",
- " 99 \n",
- " その他 \n",
- " 9999 \n",
- " その他 \n",
- " - \n",
- " 109 \n",
- " その他 \n",
- " \n",
- " \n",
- " 4 \n",
- " 2022-11-25 \n",
- " 13090 \n",
- " NEXTFUNDSChinaAMC・中国株式・上証50連動型上場投信 \n",
- " 99 \n",
- " その他 \n",
- " 9999 \n",
- " その他 \n",
- " - \n",
- " 109 \n",
- " その他 \n",
- " \n",
- " \n",
- " ... \n",
- " ... \n",
- " ... \n",
- " ... \n",
- " ... \n",
- " ... \n",
- " ... \n",
- " ... \n",
- " ... \n",
- " ... \n",
- " ... \n",
- " \n",
- " \n",
- " 4221 \n",
- " 2022-11-25 \n",
- " 99930 \n",
- " ヤマザワ \n",
- " 14 \n",
- " 小売 \n",
- " 6100 \n",
- " 小売業 \n",
- " TOPIX Small 2 \n",
- " 112 \n",
- " スタンダード \n",
- " \n",
- " \n",
- " 4222 \n",
- " 2022-11-25 \n",
- " 99940 \n",
- " やまや \n",
- " 14 \n",
- " 小売 \n",
- " 6100 \n",
- " 小売業 \n",
- " TOPIX Small 2 \n",
- " 112 \n",
- " スタンダード \n",
- " \n",
- " \n",
- " 4223 \n",
- " 2022-11-25 \n",
- " 99950 \n",
- " グローセル \n",
- " 13 \n",
- " 商社・卸売 \n",
- " 6050 \n",
- " 卸売業 \n",
- " TOPIX Small 2 \n",
- " 111 \n",
- " プライム \n",
- " \n",
- " \n",
- " 4224 \n",
- " 2022-11-25 \n",
- " 99960 \n",
- " サトー商会 \n",
- " 13 \n",
- " 商社・卸売 \n",
- " 6050 \n",
- " 卸売業 \n",
- " - \n",
- " 112 \n",
- " スタンダード \n",
- " \n",
- " \n",
- " 4225 \n",
- " 2022-11-25 \n",
- " 99970 \n",
- " ベルーナ \n",
- " 14 \n",
- " 小売 \n",
- " 6100 \n",
- " 小売業 \n",
- " TOPIX Small 1 \n",
- " 111 \n",
- " プライム \n",
- " \n",
- " \n",
- "
\n",
- "
4226 rows × 10 columns
\n",
- "
\n",
- "
\n",
- " \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " \n",
- "\n",
- " \n",
- "
\n",
- "
\n",
- " "
- ]
- },
- "metadata": {},
- "execution_count": 7
- }
- ]
+ "execution_count": null,
+ "outputs": []
},
{
"cell_type": "code",
@@ -1064,143 +261,10 @@
"df_info[df_info.isnull().any(axis=1)]\n"
],
"metadata": {
- "colab": {
- "base_uri": "https://localhost:8080/",
- "height": 0
- },
- "id": "ucCsQuUJlnTV",
- "outputId": "60d587c8-5451-48f0-9e11-60fe793eb5c8"
+ "id": "ucCsQuUJlnTV"
},
- "execution_count": 8,
- "outputs": [
- {
- "output_type": "execute_result",
- "data": {
- "text/plain": [
- "Empty DataFrame\n",
- "Columns: [Date, Code, CompanyName, Sector17Code, Sector17CodeName, Sector33Code, Sector33CodeName, ScaleCategory, MarketCode, MarketCodeName]\n",
- "Index: []"
- ],
- "text/html": [
- "\n",
- " \n",
- "
\n",
- "
\n",
- "\n",
- "
\n",
- " \n",
- " \n",
- " \n",
- " Date \n",
- " Code \n",
- " CompanyName \n",
- " Sector17Code \n",
- " Sector17CodeName \n",
- " Sector33Code \n",
- " Sector33CodeName \n",
- " ScaleCategory \n",
- " MarketCode \n",
- " MarketCodeName \n",
- " \n",
- " \n",
- " \n",
- " \n",
- "
\n",
- "
\n",
- "
\n",
- " \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " \n",
- "\n",
- " \n",
- "
\n",
- "
\n",
- " "
- ]
- },
- "metadata": {},
- "execution_count": 8
- }
- ]
+ "execution_count": null,
+ "outputs": []
},
{
"cell_type": "markdown",
@@ -1228,173 +292,10 @@
"df_info[df_info[\"Code\"].isin([\"25930\", \"25935\"])]\n"
],
"metadata": {
- "colab": {
- "base_uri": "https://localhost:8080/",
- "height": 0
- },
- "id": "kFP4cl2Jg6Rw",
- "outputId": "e182d861-c75c-416e-c9f9-20dca94cab9c"
+ "id": "kFP4cl2Jg6Rw"
},
- "execution_count": 9,
- "outputs": [
- {
- "output_type": "execute_result",
- "data": {
- "text/plain": [
- " Date Code CompanyName Sector17Code Sector17CodeName Sector33Code \\\n",
- "613 2022-11-25 25930 伊藤園 1 食品 3050 \n",
- "614 2022-11-25 25935 株式会社伊藤園第1種 1 食品 3050 \n",
- "\n",
- " Sector33CodeName ScaleCategory MarketCode MarketCodeName \n",
- "613 食料品 TOPIX Mid400 111 プライム \n",
- "614 食料品 - 111 プライム "
- ],
- "text/html": [
- "\n",
- " \n",
- "
\n",
- "
\n",
- "\n",
- "
\n",
- " \n",
- " \n",
- " \n",
- " Date \n",
- " Code \n",
- " CompanyName \n",
- " Sector17Code \n",
- " Sector17CodeName \n",
- " Sector33Code \n",
- " Sector33CodeName \n",
- " ScaleCategory \n",
- " MarketCode \n",
- " MarketCodeName \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " 613 \n",
- " 2022-11-25 \n",
- " 25930 \n",
- " 伊藤園 \n",
- " 1 \n",
- " 食品 \n",
- " 3050 \n",
- " 食料品 \n",
- " TOPIX Mid400 \n",
- " 111 \n",
- " プライム \n",
- " \n",
- " \n",
- " 614 \n",
- " 2022-11-25 \n",
- " 25935 \n",
- " 株式会社伊藤園第1種 \n",
- " 1 \n",
- " 食品 \n",
- " 3050 \n",
- " 食料品 \n",
- " - \n",
- " 111 \n",
- " プライム \n",
- " \n",
- " \n",
- "
\n",
- "
\n",
- "
\n",
- " \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " \n",
- "\n",
- " \n",
- "
\n",
- "
\n",
- " "
- ]
- },
- "metadata": {},
- "execution_count": 9
- }
- ]
+ "execution_count": null,
+ "outputs": []
},
{
"cell_type": "markdown",
@@ -1421,324 +322,10 @@
"df_info[df_info[\"Sector33Code\"] == \"9999\"]\n"
],
"metadata": {
- "colab": {
- "base_uri": "https://localhost:8080/",
- "height": 0
- },
- "id": "Ku5ithg-oQid",
- "outputId": "94e368da-3c33-402b-9b53-6725d9695b37"
+ "id": "Ku5ithg-oQid"
},
- "execution_count": 10,
- "outputs": [
- {
- "output_type": "execute_result",
- "data": {
- "text/plain": [
- " Date Code CompanyName Sector17Code \\\n",
- "1 2022-11-25 13050 ダイワ上場投信−トピックス 99 \n",
- "2 2022-11-25 13060 NEXTFUNDSTOPIX連動型上場投信 99 \n",
- "3 2022-11-25 13080 上場インデックスファンドTOPIX 99 \n",
- "4 2022-11-25 13090 NEXTFUNDSChinaAMC・中国株式・上証50連動型上場投信 99 \n",
- "5 2022-11-25 13110 NEXTFUNDSTOPIXCore30連動型上場投信 99 \n",
- "... ... ... ... ... \n",
- "3912 2022-11-25 92820 いちごグリーンインフラ投資法人 99 \n",
- "3913 2022-11-25 92840 カナディアン・ソーラー・インフラ投資法人 99 \n",
- "3914 2022-11-25 92850 東京インフラ・エネルギー投資法人 99 \n",
- "3915 2022-11-25 92860 エネクス・インフラ投資法人 99 \n",
- "3916 2022-11-25 92870 ジャパン・インフラファンド投資法人 99 \n",
- "\n",
- " Sector17CodeName Sector33Code Sector33CodeName ScaleCategory MarketCode \\\n",
- "1 その他 9999 その他 - 109 \n",
- "2 その他 9999 その他 - 109 \n",
- "3 その他 9999 その他 - 109 \n",
- "4 その他 9999 その他 - 109 \n",
- "5 その他 9999 その他 - 109 \n",
- "... ... ... ... ... ... \n",
- "3912 その他 9999 その他 - 109 \n",
- "3913 その他 9999 その他 - 109 \n",
- "3914 その他 9999 その他 - 109 \n",
- "3915 その他 9999 その他 - 109 \n",
- "3916 その他 9999 その他 - 109 \n",
- "\n",
- " MarketCodeName \n",
- "1 その他 \n",
- "2 その他 \n",
- "3 その他 \n",
- "4 その他 \n",
- "5 その他 \n",
- "... ... \n",
- "3912 その他 \n",
- "3913 その他 \n",
- "3914 その他 \n",
- "3915 その他 \n",
- "3916 その他 \n",
- "\n",
- "[374 rows x 10 columns]"
- ],
- "text/html": [
- "\n",
- " \n",
- "
\n",
- "
\n",
- "\n",
- "
\n",
- " \n",
- " \n",
- " \n",
- " Date \n",
- " Code \n",
- " CompanyName \n",
- " Sector17Code \n",
- " Sector17CodeName \n",
- " Sector33Code \n",
- " Sector33CodeName \n",
- " ScaleCategory \n",
- " MarketCode \n",
- " MarketCodeName \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " 1 \n",
- " 2022-11-25 \n",
- " 13050 \n",
- " ダイワ上場投信−トピックス \n",
- " 99 \n",
- " その他 \n",
- " 9999 \n",
- " その他 \n",
- " - \n",
- " 109 \n",
- " その他 \n",
- " \n",
- " \n",
- " 2 \n",
- " 2022-11-25 \n",
- " 13060 \n",
- " NEXTFUNDSTOPIX連動型上場投信 \n",
- " 99 \n",
- " その他 \n",
- " 9999 \n",
- " その他 \n",
- " - \n",
- " 109 \n",
- " その他 \n",
- " \n",
- " \n",
- " 3 \n",
- " 2022-11-25 \n",
- " 13080 \n",
- " 上場インデックスファンドTOPIX \n",
- " 99 \n",
- " その他 \n",
- " 9999 \n",
- " その他 \n",
- " - \n",
- " 109 \n",
- " その他 \n",
- " \n",
- " \n",
- " 4 \n",
- " 2022-11-25 \n",
- " 13090 \n",
- " NEXTFUNDSChinaAMC・中国株式・上証50連動型上場投信 \n",
- " 99 \n",
- " その他 \n",
- " 9999 \n",
- " その他 \n",
- " - \n",
- " 109 \n",
- " その他 \n",
- " \n",
- " \n",
- " 5 \n",
- " 2022-11-25 \n",
- " 13110 \n",
- " NEXTFUNDSTOPIXCore30連動型上場投信 \n",
- " 99 \n",
- " その他 \n",
- " 9999 \n",
- " その他 \n",
- " - \n",
- " 109 \n",
- " その他 \n",
- " \n",
- " \n",
- " ... \n",
- " ... \n",
- " ... \n",
- " ... \n",
- " ... \n",
- " ... \n",
- " ... \n",
- " ... \n",
- " ... \n",
- " ... \n",
- " ... \n",
- " \n",
- " \n",
- " 3912 \n",
- " 2022-11-25 \n",
- " 92820 \n",
- " いちごグリーンインフラ投資法人 \n",
- " 99 \n",
- " その他 \n",
- " 9999 \n",
- " その他 \n",
- " - \n",
- " 109 \n",
- " その他 \n",
- " \n",
- " \n",
- " 3913 \n",
- " 2022-11-25 \n",
- " 92840 \n",
- " カナディアン・ソーラー・インフラ投資法人 \n",
- " 99 \n",
- " その他 \n",
- " 9999 \n",
- " その他 \n",
- " - \n",
- " 109 \n",
- " その他 \n",
- " \n",
- " \n",
- " 3914 \n",
- " 2022-11-25 \n",
- " 92850 \n",
- " 東京インフラ・エネルギー投資法人 \n",
- " 99 \n",
- " その他 \n",
- " 9999 \n",
- " その他 \n",
- " - \n",
- " 109 \n",
- " その他 \n",
- " \n",
- " \n",
- " 3915 \n",
- " 2022-11-25 \n",
- " 92860 \n",
- " エネクス・インフラ投資法人 \n",
- " 99 \n",
- " その他 \n",
- " 9999 \n",
- " その他 \n",
- " - \n",
- " 109 \n",
- " その他 \n",
- " \n",
- " \n",
- " 3916 \n",
- " 2022-11-25 \n",
- " 92870 \n",
- " ジャパン・インフラファンド投資法人 \n",
- " 99 \n",
- " その他 \n",
- " 9999 \n",
- " その他 \n",
- " - \n",
- " 109 \n",
- " その他 \n",
- " \n",
- " \n",
- "
\n",
- "
374 rows × 10 columns
\n",
- "
\n",
- "
\n",
- " \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " \n",
- "\n",
- " \n",
- "
\n",
- "
\n",
- " "
- ]
- },
- "metadata": {},
- "execution_count": 10
- }
- ]
+ "execution_count": null,
+ "outputs": []
},
{
"cell_type": "markdown",
@@ -1758,7 +345,7 @@
"metadata": {
"id": "HSBgCcYlkGfp"
},
- "execution_count": 11,
+ "execution_count": null,
"outputs": []
},
{
@@ -1782,55 +369,10 @@
"px.bar(df_sector, x=\"Sector17CodeName\", y=\"Count\", title=\"17業種別の企業数\")\n"
],
"metadata": {
- "colab": {
- "base_uri": "https://localhost:8080/",
- "height": 0
- },
- "id": "kG5wuV0zFsgO",
- "outputId": "031839d6-a33d-4809-9ddc-97fde0d59df3"
+ "id": "kG5wuV0zFsgO"
},
- "execution_count": 12,
- "outputs": [
- {
- "output_type": "display_data",
- "data": {
- "text/html": [
- "\n",
- " \n",
- "\n",
- " \n",
- "\n",
- ""
- ]
- },
- "metadata": {}
- }
- ]
+ "execution_count": null,
+ "outputs": []
},
{
"cell_type": "markdown",
@@ -1853,55 +395,10 @@
"px.bar(df_sector, x=\"Sector33CodeName\", y=\"Count\", title=\"33業種別の企業数\")\n"
],
"metadata": {
- "id": "Zr9o0Z0k5YEv",
- "colab": {
- "base_uri": "https://localhost:8080/",
- "height": 0
- },
- "outputId": "25644b32-3ebd-4c2a-bf2c-9469c2a68df2"
+ "id": "Zr9o0Z0k5YEv"
},
- "execution_count": 13,
- "outputs": [
- {
- "output_type": "display_data",
- "data": {
- "text/html": [
- "\n",
- " \n",
- "\n",
- " \n",
- "\n",
- ""
- ]
- },
- "metadata": {}
- }
- ]
+ "execution_count": null,
+ "outputs": []
},
{
"cell_type": "markdown",
@@ -1921,55 +418,10 @@
"px.bar(df_market, x=\"MarketCodeName\", y=\"Count\", title=\"市場区分別の企業数\")\n"
],
"metadata": {
- "colab": {
- "base_uri": "https://localhost:8080/",
- "height": 0
- },
- "id": "kU25HFxB2zvk",
- "outputId": "e9055200-92d4-4b74-fc36-5f27fe3d8afb"
+ "id": "kU25HFxB2zvk"
},
- "execution_count": 14,
- "outputs": [
- {
- "output_type": "display_data",
- "data": {
- "text/html": [
- "\n",
- " \n",
- "\n",
- " \n",
- "\n",
- ""
- ]
- },
- "metadata": {}
- }
- ]
+ "execution_count": null,
+ "outputs": []
},
{
"cell_type": "markdown",
@@ -1992,8 +444,9 @@
"# 業種別及び市場名でグルーピング\n",
"df_sector_market = df.groupby([\n",
" \"Sector33CodeName\", \"MarketCodeName\"\n",
- "]).size().to_frame(\"Count\").reset_index().sort_values(by=\"Count\",\n",
+ "]).size().to_frame(\"Count\").reset_index().sort_values(by=[\"MarketCodeName\", \"Count\"],\n",
" ascending=False)\n",
+ "\n",
"px.bar(df_sector_market,\n",
" x=\"Sector33CodeName\",\n",
" y=\"Count\",\n",
@@ -2002,60 +455,15 @@
" title=\"33業種及び市場区分別の企業数\")\n"
],
"metadata": {
- "colab": {
- "base_uri": "https://localhost:8080/",
- "height": 0
- },
- "id": "VRWWAS8G_hZc",
- "outputId": "2766e7cd-b098-4c59-b3d2-c7420218d54e"
+ "id": "VRWWAS8G_hZc"
},
- "execution_count": 15,
- "outputs": [
- {
- "output_type": "display_data",
- "data": {
- "text/html": [
- "\n",
- " \n",
- "\n",
- " \n",
- "\n",
- ""
- ]
- },
- "metadata": {}
- }
- ]
+ "execution_count": null,
+ "outputs": []
},
{
"cell_type": "markdown",
"source": [
- "### 過去時点(2017年1月4日)の銘柄一覧で上記同様のグラフ描画"
+ "### 過去時点(1年前)の銘柄一覧で上記同様のグラフ描画"
],
"metadata": {
"id": "0DMfmDj-GLEj"
@@ -2064,18 +472,19 @@
{
"cell_type": "code",
"source": [
- "df_info = cli.get_listed_info(date_yyyymmdd=\"20170104\")\n",
+ "d = datetime.now() - timedelta(days=365)\n",
+ "df_info = cli.get_listed_info(date_yyyymmdd=d.strftime(format=\"%Y%m%d\"))\n",
"\n",
"# ETF, REIT, インフラファンド等の33業種以外のデータを除外\n",
"df = df_info[df_info[\"Sector33Code\"] != \"9999\"]\n",
"\n",
"# さらにプライム、スタンダード、グロース及びTokyoProMarket銘柄にフィルタ\n",
- "df = df[df[\"MarketCodeName\"].isin([\"東証一部\", \"東証二部\", \"マザーズ\", \"TOKYO PRO MARKET\", \"JASDAQ スタンダード\", \"JASDAQ グロース\"])]\n",
+ "df = df[df[\"MarketCodeName\"].isin([\"プライム\", \"スタンダード\", \"グロース\", \"TOKYO PRO MARKET\"])]\n",
"\n",
"# 業種別及び市場名でグルーピング\n",
"df_sector_market = df.groupby([\n",
" \"Sector33CodeName\", \"MarketCodeName\"\n",
- "]).size().to_frame(\"Count\").reset_index().sort_values(by=\"Count\",\n",
+ "]).size().to_frame(\"Count\").reset_index().sort_values(by=[\"MarketCodeName\", \"Count\"],\n",
" ascending=False)\n",
"px.bar(df_sector_market,\n",
" x=\"Sector33CodeName\",\n",
@@ -2085,64 +494,17 @@
" title=\"33業種及び市場区分別の企業数\")\n"
],
"metadata": {
- "colab": {
- "base_uri": "https://localhost:8080/",
- "height": 0
- },
- "id": "rd3YEL6fGSZT",
- "outputId": "bff74520-9767-41c3-8cb4-47fd151a56d9"
+ "id": "hx9apk4fPfEm"
},
- "execution_count": 16,
- "outputs": [
- {
- "output_type": "display_data",
- "data": {
- "text/html": [
- "\n",
- " \n",
- "\n",
- " \n",
- "\n",
- ""
- ]
- },
- "metadata": {}
- }
- ]
+ "execution_count": null,
+ "outputs": []
},
{
"cell_type": "markdown",
"source": [
- "# 株価情報 API(毎営業日の18時30分頃データ更新)\n",
- "\n",
- "(注)2022/11/25時点の情報です。\n",
+ "# 株価情報 API(毎営業日の17時00分頃データ更新)\n",
"\n",
- "2017年1月から直近までの株価データを取得することができます。 \n",
+ "株価データを取得することができます。 \n",
"株価及び取引高は、株式分割・併合を考慮した調整済み株価(小数点第2位四捨五入)と調整前の株価の両方を取得することができます。 \n",
"\n",
"なお、データを取得する際には、株式銘柄コード(code)または日付(date)の指定が必須となっています。\n",
@@ -2153,32 +515,6 @@
"id": "IOurY_o-Y9Cl"
}
},
- {
- "cell_type": "markdown",
- "source": [
- "## API出力データ概要\n",
- "\n",
- "|変数名|概要|\n",
- "|---|---|\n",
- "|Code|株式銘柄コード(5桁表示)|\n",
- "|Date|取引日|\n",
- "|Open|始値(調整前)|\n",
- "|High|高値(調整前)|\n",
- "|Low|安値(調整前)|\n",
- "|Close|終値(調整前)|\n",
- "|Volume|取引高(調整前)|\n",
- "|TurnoverValue|取引代金|\n",
- "|AdjustmentFactor|調整係数|\n",
- "|AdjustmentOpen|調整済み始値|\n",
- "|AdjustmentHigh|調整済み高値|\n",
- "|AdjustmentLow|調整済み安値|\n",
- "|AdjustmentClose|調整済み終値|\n",
- "|AdjustmentVolume|調整済み取引高|"
- ],
- "metadata": {
- "id": "f6QhJbiXoNco"
- }
- },
{
"cell_type": "markdown",
"source": [
@@ -2202,401 +538,10 @@
"df_quotes_bycode\n"
],
"metadata": {
- "colab": {
- "base_uri": "https://localhost:8080/",
- "height": 0
- },
- "id": "AMMohwc-js08",
- "outputId": "95500a3c-84be-4674-db36-1eee2fdd7380"
+ "id": "AMMohwc-js08"
},
- "execution_count": 17,
- "outputs": [
- {
- "output_type": "stream",
- "name": "stdout",
- "text": [
- "\n",
- "Int64Index: 1439 entries, 0 to 1438\n",
- "Data columns (total 14 columns):\n",
- " # Column Non-Null Count Dtype \n",
- "--- ------ -------------- ----- \n",
- " 0 Code 1439 non-null object \n",
- " 1 Date 1439 non-null datetime64[ns]\n",
- " 2 Open 1438 non-null float64 \n",
- " 3 High 1438 non-null float64 \n",
- " 4 Low 1438 non-null float64 \n",
- " 5 Close 1438 non-null float64 \n",
- " 6 Volume 1438 non-null float64 \n",
- " 7 TurnoverValue 1438 non-null float64 \n",
- " 8 AdjustmentFactor 1439 non-null float64 \n",
- " 9 AdjustmentOpen 1438 non-null float64 \n",
- " 10 AdjustmentHigh 1438 non-null float64 \n",
- " 11 AdjustmentLow 1438 non-null float64 \n",
- " 12 AdjustmentClose 1438 non-null float64 \n",
- " 13 AdjustmentVolume 1438 non-null float64 \n",
- "dtypes: datetime64[ns](1), float64(12), object(1)\n",
- "memory usage: 168.6+ KB\n",
- "\n",
- "\n"
- ]
- },
- {
- "output_type": "execute_result",
- "data": {
- "text/plain": [
- " Code Date Open High Low Close Volume \\\n",
- "0 86970 2017-01-04 1690.0 1713.0 1681.0 1706.0 1999000.0 \n",
- "1 86970 2017-01-05 1703.0 1716.0 1696.0 1712.0 2137100.0 \n",
- "2 86970 2017-01-06 1694.0 1698.0 1688.0 1691.0 1678400.0 \n",
- "3 86970 2017-01-10 1682.0 1688.0 1662.0 1664.0 1883600.0 \n",
- "4 86970 2017-01-11 1700.0 1702.0 1682.0 1687.0 1786100.0 \n",
- "... ... ... ... ... ... ... ... \n",
- "1434 86970 2022-11-17 1969.0 1985.5 1969.0 1972.0 1035900.0 \n",
- "1435 86970 2022-11-18 1994.5 1994.5 1965.5 1967.0 1257700.0 \n",
- "1436 86970 2022-11-21 1967.0 1973.5 1949.0 1957.0 918900.0 \n",
- "1437 86970 2022-11-22 1961.5 1981.0 1961.0 1971.5 1152300.0 \n",
- "1438 86970 2022-11-24 1996.5 2021.0 1994.0 2018.5 1314100.0 \n",
- "\n",
- " TurnoverValue AdjustmentFactor AdjustmentOpen AdjustmentHigh \\\n",
- "0 3.401429e+09 1.0 1690.0 1713.0 \n",
- "1 3.653718e+09 1.0 1703.0 1716.0 \n",
- "2 2.841347e+09 1.0 1694.0 1698.0 \n",
- "3 3.147536e+09 1.0 1682.0 1688.0 \n",
- "4 3.019238e+09 1.0 1700.0 1702.0 \n",
- "... ... ... ... ... \n",
- "1434 2.044283e+09 1.0 1969.0 1985.5 \n",
- "1435 2.480479e+09 1.0 1994.5 1994.5 \n",
- "1436 1.798190e+09 1.0 1967.0 1973.5 \n",
- "1437 2.272961e+09 1.0 1961.5 1981.0 \n",
- "1438 2.645815e+09 1.0 1996.5 2021.0 \n",
- "\n",
- " AdjustmentLow AdjustmentClose AdjustmentVolume \n",
- "0 1681.0 1706.0 1999000.0 \n",
- "1 1696.0 1712.0 2137100.0 \n",
- "2 1688.0 1691.0 1678400.0 \n",
- "3 1662.0 1664.0 1883600.0 \n",
- "4 1682.0 1687.0 1786100.0 \n",
- "... ... ... ... \n",
- "1434 1969.0 1972.0 1035900.0 \n",
- "1435 1965.5 1967.0 1257700.0 \n",
- "1436 1949.0 1957.0 918900.0 \n",
- "1437 1961.0 1971.5 1152300.0 \n",
- "1438 1994.0 2018.5 1314100.0 \n",
- "\n",
- "[1439 rows x 14 columns]"
- ],
- "text/html": [
- "\n",
- " \n",
- "
\n",
- "
\n",
- "\n",
- "
\n",
- " \n",
- " \n",
- " \n",
- " Code \n",
- " Date \n",
- " Open \n",
- " High \n",
- " Low \n",
- " Close \n",
- " Volume \n",
- " TurnoverValue \n",
- " AdjustmentFactor \n",
- " AdjustmentOpen \n",
- " AdjustmentHigh \n",
- " AdjustmentLow \n",
- " AdjustmentClose \n",
- " AdjustmentVolume \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " 0 \n",
- " 86970 \n",
- " 2017-01-04 \n",
- " 1690.0 \n",
- " 1713.0 \n",
- " 1681.0 \n",
- " 1706.0 \n",
- " 1999000.0 \n",
- " 3.401429e+09 \n",
- " 1.0 \n",
- " 1690.0 \n",
- " 1713.0 \n",
- " 1681.0 \n",
- " 1706.0 \n",
- " 1999000.0 \n",
- " \n",
- " \n",
- " 1 \n",
- " 86970 \n",
- " 2017-01-05 \n",
- " 1703.0 \n",
- " 1716.0 \n",
- " 1696.0 \n",
- " 1712.0 \n",
- " 2137100.0 \n",
- " 3.653718e+09 \n",
- " 1.0 \n",
- " 1703.0 \n",
- " 1716.0 \n",
- " 1696.0 \n",
- " 1712.0 \n",
- " 2137100.0 \n",
- " \n",
- " \n",
- " 2 \n",
- " 86970 \n",
- " 2017-01-06 \n",
- " 1694.0 \n",
- " 1698.0 \n",
- " 1688.0 \n",
- " 1691.0 \n",
- " 1678400.0 \n",
- " 2.841347e+09 \n",
- " 1.0 \n",
- " 1694.0 \n",
- " 1698.0 \n",
- " 1688.0 \n",
- " 1691.0 \n",
- " 1678400.0 \n",
- " \n",
- " \n",
- " 3 \n",
- " 86970 \n",
- " 2017-01-10 \n",
- " 1682.0 \n",
- " 1688.0 \n",
- " 1662.0 \n",
- " 1664.0 \n",
- " 1883600.0 \n",
- " 3.147536e+09 \n",
- " 1.0 \n",
- " 1682.0 \n",
- " 1688.0 \n",
- " 1662.0 \n",
- " 1664.0 \n",
- " 1883600.0 \n",
- " \n",
- " \n",
- " 4 \n",
- " 86970 \n",
- " 2017-01-11 \n",
- " 1700.0 \n",
- " 1702.0 \n",
- " 1682.0 \n",
- " 1687.0 \n",
- " 1786100.0 \n",
- " 3.019238e+09 \n",
- " 1.0 \n",
- " 1700.0 \n",
- " 1702.0 \n",
- " 1682.0 \n",
- " 1687.0 \n",
- " 1786100.0 \n",
- " \n",
- " \n",
- " ... \n",
- " ... \n",
- " ... \n",
- " ... \n",
- " ... \n",
- " ... \n",
- " ... \n",
- " ... \n",
- " ... \n",
- " ... \n",
- " ... \n",
- " ... \n",
- " ... \n",
- " ... \n",
- " ... \n",
- " \n",
- " \n",
- " 1434 \n",
- " 86970 \n",
- " 2022-11-17 \n",
- " 1969.0 \n",
- " 1985.5 \n",
- " 1969.0 \n",
- " 1972.0 \n",
- " 1035900.0 \n",
- " 2.044283e+09 \n",
- " 1.0 \n",
- " 1969.0 \n",
- " 1985.5 \n",
- " 1969.0 \n",
- " 1972.0 \n",
- " 1035900.0 \n",
- " \n",
- " \n",
- " 1435 \n",
- " 86970 \n",
- " 2022-11-18 \n",
- " 1994.5 \n",
- " 1994.5 \n",
- " 1965.5 \n",
- " 1967.0 \n",
- " 1257700.0 \n",
- " 2.480479e+09 \n",
- " 1.0 \n",
- " 1994.5 \n",
- " 1994.5 \n",
- " 1965.5 \n",
- " 1967.0 \n",
- " 1257700.0 \n",
- " \n",
- " \n",
- " 1436 \n",
- " 86970 \n",
- " 2022-11-21 \n",
- " 1967.0 \n",
- " 1973.5 \n",
- " 1949.0 \n",
- " 1957.0 \n",
- " 918900.0 \n",
- " 1.798190e+09 \n",
- " 1.0 \n",
- " 1967.0 \n",
- " 1973.5 \n",
- " 1949.0 \n",
- " 1957.0 \n",
- " 918900.0 \n",
- " \n",
- " \n",
- " 1437 \n",
- " 86970 \n",
- " 2022-11-22 \n",
- " 1961.5 \n",
- " 1981.0 \n",
- " 1961.0 \n",
- " 1971.5 \n",
- " 1152300.0 \n",
- " 2.272961e+09 \n",
- " 1.0 \n",
- " 1961.5 \n",
- " 1981.0 \n",
- " 1961.0 \n",
- " 1971.5 \n",
- " 1152300.0 \n",
- " \n",
- " \n",
- " 1438 \n",
- " 86970 \n",
- " 2022-11-24 \n",
- " 1996.5 \n",
- " 2021.0 \n",
- " 1994.0 \n",
- " 2018.5 \n",
- " 1314100.0 \n",
- " 2.645815e+09 \n",
- " 1.0 \n",
- " 1996.5 \n",
- " 2021.0 \n",
- " 1994.0 \n",
- " 2018.5 \n",
- " 1314100.0 \n",
- " \n",
- " \n",
- "
\n",
- "
1439 rows × 14 columns
\n",
- "
\n",
- "
\n",
- " \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " \n",
- "\n",
- " \n",
- "
\n",
- "
\n",
- " "
- ]
- },
- "metadata": {},
- "execution_count": 17
- }
- ]
+ "execution_count": null,
+ "outputs": []
},
{
"cell_type": "code",
@@ -2605,178 +550,10 @@
"df_quotes_bycode[df_quotes_bycode.isnull().any(axis=1)]\n"
],
"metadata": {
- "colab": {
- "base_uri": "https://localhost:8080/",
- "height": 0
- },
- "id": "SBsxOE2unqEV",
- "outputId": "63319bad-fb95-48a1-e3fe-acfc4c7190ec"
+ "id": "SBsxOE2unqEV"
},
- "execution_count": 18,
- "outputs": [
- {
- "output_type": "execute_result",
- "data": {
- "text/plain": [
- " Code Date Open High Low Close Volume TurnoverValue \\\n",
- "913 86970 2020-10-01 NaN NaN NaN NaN NaN NaN \n",
- "\n",
- " AdjustmentFactor AdjustmentOpen AdjustmentHigh AdjustmentLow \\\n",
- "913 1.0 NaN NaN NaN \n",
- "\n",
- " AdjustmentClose AdjustmentVolume \n",
- "913 NaN NaN "
- ],
- "text/html": [
- "\n",
- " \n",
- "
\n",
- "
\n",
- "\n",
- "
\n",
- " \n",
- " \n",
- " \n",
- " Code \n",
- " Date \n",
- " Open \n",
- " High \n",
- " Low \n",
- " Close \n",
- " Volume \n",
- " TurnoverValue \n",
- " AdjustmentFactor \n",
- " AdjustmentOpen \n",
- " AdjustmentHigh \n",
- " AdjustmentLow \n",
- " AdjustmentClose \n",
- " AdjustmentVolume \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " 913 \n",
- " 86970 \n",
- " 2020-10-01 \n",
- " NaN \n",
- " NaN \n",
- " NaN \n",
- " NaN \n",
- " NaN \n",
- " NaN \n",
- " 1.0 \n",
- " NaN \n",
- " NaN \n",
- " NaN \n",
- " NaN \n",
- " NaN \n",
- " \n",
- " \n",
- "
\n",
- "
\n",
- "
\n",
- " \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " \n",
- "\n",
- " \n",
- "
\n",
- "
\n",
- " "
- ]
- },
- "metadata": {},
- "execution_count": 18
- }
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "2020/10/1は、システム障害により終日売買停止のため、NaNが入っている。"
- ],
- "metadata": {
- "id": "yAChBuYSn4Om"
- }
+ "execution_count": null,
+ "outputs": []
},
{
"cell_type": "markdown",
@@ -2790,7 +567,8 @@
{
"cell_type": "code",
"source": [
- "df_quotes_bydate = cli.get_prices_daily_quotes(date_yyyymmdd=20220801)\n",
+ "d = datetime.now() - timedelta(days=365)\n",
+ "df_quotes_bydate = cli.get_prices_daily_quotes(date_yyyymmdd=d.strftime(format=\"%Y%m%d\"))\n",
"\n",
"# データフレームの情報を取得\n",
"df_quotes_bydate.info()\n",
@@ -2801,401 +579,10 @@
"df_quotes_bydate\n"
],
"metadata": {
- "colab": {
- "base_uri": "https://localhost:8080/",
- "height": 0
- },
- "id": "zLbZCoQpnqm3",
- "outputId": "1e9040ea-f59f-41e1-a68f-8adc6c0670d9"
+ "id": "zLbZCoQpnqm3"
},
- "execution_count": 19,
- "outputs": [
- {
- "output_type": "stream",
- "name": "stdout",
- "text": [
- "\n",
- "Int64Index: 4196 entries, 0 to 4195\n",
- "Data columns (total 14 columns):\n",
- " # Column Non-Null Count Dtype \n",
- "--- ------ -------------- ----- \n",
- " 0 Code 4196 non-null object \n",
- " 1 Date 4196 non-null datetime64[ns]\n",
- " 2 Open 4067 non-null float64 \n",
- " 3 High 4067 non-null float64 \n",
- " 4 Low 4067 non-null float64 \n",
- " 5 Close 4067 non-null float64 \n",
- " 6 Volume 4067 non-null float64 \n",
- " 7 TurnoverValue 4067 non-null float64 \n",
- " 8 AdjustmentFactor 4196 non-null float64 \n",
- " 9 AdjustmentOpen 4067 non-null float64 \n",
- " 10 AdjustmentHigh 4067 non-null float64 \n",
- " 11 AdjustmentLow 4067 non-null float64 \n",
- " 12 AdjustmentClose 4067 non-null float64 \n",
- " 13 AdjustmentVolume 4067 non-null float64 \n",
- "dtypes: datetime64[ns](1), float64(12), object(1)\n",
- "memory usage: 491.7+ KB\n",
- "\n",
- "\n"
- ]
- },
- {
- "output_type": "execute_result",
- "data": {
- "text/plain": [
- " Code Date Open High Low Close Volume \\\n",
- "0 13010 2022-08-01 3630.0 3650.0 3615.0 3650.0 10600.0 \n",
- "1 13050 2022-08-01 2024.5 2043.0 2019.5 2041.0 69750.0 \n",
- "2 13060 2022-08-01 2001.0 2020.5 1996.5 2019.0 1645480.0 \n",
- "3 13080 2022-08-01 1979.5 1997.5 1972.5 1996.0 240200.0 \n",
- "4 13090 2022-08-01 42840.0 43100.0 42210.0 42780.0 87.0 \n",
- "... ... ... ... ... ... ... ... \n",
- "4191 99930 2022-08-01 1420.0 1422.0 1418.0 1420.0 10800.0 \n",
- "4192 99940 2022-08-01 2624.0 2662.0 2624.0 2662.0 5000.0 \n",
- "4193 99950 2022-08-01 425.0 425.0 410.0 410.0 129300.0 \n",
- "4194 99960 2022-08-01 1240.0 1241.0 1235.0 1241.0 3300.0 \n",
- "4195 99970 2022-08-01 730.0 762.0 720.0 753.0 566300.0 \n",
- "\n",
- " TurnoverValue AdjustmentFactor AdjustmentOpen AdjustmentHigh \\\n",
- "0 3.860450e+07 1.0 3630.0 3650.0 \n",
- "1 1.421875e+08 1.0 2024.5 2043.0 \n",
- "2 3.311800e+09 1.0 2001.0 2020.5 \n",
- "3 4.784298e+08 1.0 1979.5 1997.5 \n",
- "4 3.716680e+06 1.0 42840.0 43100.0 \n",
- "... ... ... ... ... \n",
- "4191 1.532970e+07 1.0 1420.0 1422.0 \n",
- "4192 1.322050e+07 1.0 2624.0 2662.0 \n",
- "4193 5.362010e+07 1.0 425.0 425.0 \n",
- "4194 4.091000e+06 1.0 1240.0 1241.0 \n",
- "4195 4.199512e+08 1.0 730.0 762.0 \n",
- "\n",
- " AdjustmentLow AdjustmentClose AdjustmentVolume \n",
- "0 3615.0 3650.0 10600.0 \n",
- "1 2019.5 2041.0 69750.0 \n",
- "2 1996.5 2019.0 1645480.0 \n",
- "3 1972.5 1996.0 240200.0 \n",
- "4 42210.0 42780.0 87.0 \n",
- "... ... ... ... \n",
- "4191 1418.0 1420.0 10800.0 \n",
- "4192 2624.0 2662.0 5000.0 \n",
- "4193 410.0 410.0 129300.0 \n",
- "4194 1235.0 1241.0 3300.0 \n",
- "4195 720.0 753.0 566300.0 \n",
- "\n",
- "[4196 rows x 14 columns]"
- ],
- "text/html": [
- "\n",
- " \n",
- "
\n",
- "
\n",
- "\n",
- "
\n",
- " \n",
- " \n",
- " \n",
- " Code \n",
- " Date \n",
- " Open \n",
- " High \n",
- " Low \n",
- " Close \n",
- " Volume \n",
- " TurnoverValue \n",
- " AdjustmentFactor \n",
- " AdjustmentOpen \n",
- " AdjustmentHigh \n",
- " AdjustmentLow \n",
- " AdjustmentClose \n",
- " AdjustmentVolume \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " 0 \n",
- " 13010 \n",
- " 2022-08-01 \n",
- " 3630.0 \n",
- " 3650.0 \n",
- " 3615.0 \n",
- " 3650.0 \n",
- " 10600.0 \n",
- " 3.860450e+07 \n",
- " 1.0 \n",
- " 3630.0 \n",
- " 3650.0 \n",
- " 3615.0 \n",
- " 3650.0 \n",
- " 10600.0 \n",
- " \n",
- " \n",
- " 1 \n",
- " 13050 \n",
- " 2022-08-01 \n",
- " 2024.5 \n",
- " 2043.0 \n",
- " 2019.5 \n",
- " 2041.0 \n",
- " 69750.0 \n",
- " 1.421875e+08 \n",
- " 1.0 \n",
- " 2024.5 \n",
- " 2043.0 \n",
- " 2019.5 \n",
- " 2041.0 \n",
- " 69750.0 \n",
- " \n",
- " \n",
- " 2 \n",
- " 13060 \n",
- " 2022-08-01 \n",
- " 2001.0 \n",
- " 2020.5 \n",
- " 1996.5 \n",
- " 2019.0 \n",
- " 1645480.0 \n",
- " 3.311800e+09 \n",
- " 1.0 \n",
- " 2001.0 \n",
- " 2020.5 \n",
- " 1996.5 \n",
- " 2019.0 \n",
- " 1645480.0 \n",
- " \n",
- " \n",
- " 3 \n",
- " 13080 \n",
- " 2022-08-01 \n",
- " 1979.5 \n",
- " 1997.5 \n",
- " 1972.5 \n",
- " 1996.0 \n",
- " 240200.0 \n",
- " 4.784298e+08 \n",
- " 1.0 \n",
- " 1979.5 \n",
- " 1997.5 \n",
- " 1972.5 \n",
- " 1996.0 \n",
- " 240200.0 \n",
- " \n",
- " \n",
- " 4 \n",
- " 13090 \n",
- " 2022-08-01 \n",
- " 42840.0 \n",
- " 43100.0 \n",
- " 42210.0 \n",
- " 42780.0 \n",
- " 87.0 \n",
- " 3.716680e+06 \n",
- " 1.0 \n",
- " 42840.0 \n",
- " 43100.0 \n",
- " 42210.0 \n",
- " 42780.0 \n",
- " 87.0 \n",
- " \n",
- " \n",
- " ... \n",
- " ... \n",
- " ... \n",
- " ... \n",
- " ... \n",
- " ... \n",
- " ... \n",
- " ... \n",
- " ... \n",
- " ... \n",
- " ... \n",
- " ... \n",
- " ... \n",
- " ... \n",
- " ... \n",
- " \n",
- " \n",
- " 4191 \n",
- " 99930 \n",
- " 2022-08-01 \n",
- " 1420.0 \n",
- " 1422.0 \n",
- " 1418.0 \n",
- " 1420.0 \n",
- " 10800.0 \n",
- " 1.532970e+07 \n",
- " 1.0 \n",
- " 1420.0 \n",
- " 1422.0 \n",
- " 1418.0 \n",
- " 1420.0 \n",
- " 10800.0 \n",
- " \n",
- " \n",
- " 4192 \n",
- " 99940 \n",
- " 2022-08-01 \n",
- " 2624.0 \n",
- " 2662.0 \n",
- " 2624.0 \n",
- " 2662.0 \n",
- " 5000.0 \n",
- " 1.322050e+07 \n",
- " 1.0 \n",
- " 2624.0 \n",
- " 2662.0 \n",
- " 2624.0 \n",
- " 2662.0 \n",
- " 5000.0 \n",
- " \n",
- " \n",
- " 4193 \n",
- " 99950 \n",
- " 2022-08-01 \n",
- " 425.0 \n",
- " 425.0 \n",
- " 410.0 \n",
- " 410.0 \n",
- " 129300.0 \n",
- " 5.362010e+07 \n",
- " 1.0 \n",
- " 425.0 \n",
- " 425.0 \n",
- " 410.0 \n",
- " 410.0 \n",
- " 129300.0 \n",
- " \n",
- " \n",
- " 4194 \n",
- " 99960 \n",
- " 2022-08-01 \n",
- " 1240.0 \n",
- " 1241.0 \n",
- " 1235.0 \n",
- " 1241.0 \n",
- " 3300.0 \n",
- " 4.091000e+06 \n",
- " 1.0 \n",
- " 1240.0 \n",
- " 1241.0 \n",
- " 1235.0 \n",
- " 1241.0 \n",
- " 3300.0 \n",
- " \n",
- " \n",
- " 4195 \n",
- " 99970 \n",
- " 2022-08-01 \n",
- " 730.0 \n",
- " 762.0 \n",
- " 720.0 \n",
- " 753.0 \n",
- " 566300.0 \n",
- " 4.199512e+08 \n",
- " 1.0 \n",
- " 730.0 \n",
- " 762.0 \n",
- " 720.0 \n",
- " 753.0 \n",
- " 566300.0 \n",
- " \n",
- " \n",
- "
\n",
- "
4196 rows × 14 columns
\n",
- "
\n",
- "
\n",
- " \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " \n",
- "\n",
- " \n",
- "
\n",
- "
\n",
- " "
- ]
- },
- "metadata": {},
- "execution_count": 19
- }
- ]
+ "execution_count": null,
+ "outputs": []
},
{
"cell_type": "code",
@@ -3204,372 +591,10 @@
"df_quotes_bydate[df_quotes_bydate.isnull().any(axis=1)]\n"
],
"metadata": {
- "colab": {
- "base_uri": "https://localhost:8080/",
- "height": 0
- },
- "id": "kE77mWfSq1dd",
- "outputId": "286569f4-0e83-4ee8-f35c-b604b7176013"
+ "id": "kE77mWfSq1dd"
},
- "execution_count": 20,
- "outputs": [
- {
- "output_type": "execute_result",
- "data": {
- "text/plain": [
- " Code Date Open High Low Close Volume TurnoverValue \\\n",
- "8 13190 2022-08-01 NaN NaN NaN NaN NaN NaN \n",
- "12 13240 2022-08-01 NaN NaN NaN NaN NaN NaN \n",
- "46 13870 2022-08-01 NaN NaN NaN NaN NaN NaN \n",
- "54 13970 2022-08-01 NaN NaN NaN NaN NaN NaN \n",
- "68 14320 2022-08-01 NaN NaN NaN NaN NaN NaN \n",
- "... ... ... ... ... ... ... ... ... \n",
- "4064 97200 2022-08-01 NaN NaN NaN NaN NaN NaN \n",
- "4095 97800 2022-08-01 NaN NaN NaN NaN NaN NaN \n",
- "4129 98570 2022-08-01 NaN NaN NaN NaN NaN NaN \n",
- "4173 99670 2022-08-01 NaN NaN NaN NaN NaN NaN \n",
- "4178 99760 2022-08-01 NaN NaN NaN NaN NaN NaN \n",
- "\n",
- " AdjustmentFactor AdjustmentOpen AdjustmentHigh AdjustmentLow \\\n",
- "8 1.0 NaN NaN NaN \n",
- "12 1.0 NaN NaN NaN \n",
- "46 1.0 NaN NaN NaN \n",
- "54 1.0 NaN NaN NaN \n",
- "68 1.0 NaN NaN NaN \n",
- "... ... ... ... ... \n",
- "4064 1.0 NaN NaN NaN \n",
- "4095 1.0 NaN NaN NaN \n",
- "4129 1.0 NaN NaN NaN \n",
- "4173 1.0 NaN NaN NaN \n",
- "4178 1.0 NaN NaN NaN \n",
- "\n",
- " AdjustmentClose AdjustmentVolume \n",
- "8 NaN NaN \n",
- "12 NaN NaN \n",
- "46 NaN NaN \n",
- "54 NaN NaN \n",
- "68 NaN NaN \n",
- "... ... ... \n",
- "4064 NaN NaN \n",
- "4095 NaN NaN \n",
- "4129 NaN NaN \n",
- "4173 NaN NaN \n",
- "4178 NaN NaN \n",
- "\n",
- "[129 rows x 14 columns]"
- ],
- "text/html": [
- "\n",
- " \n",
- "
\n",
- "
\n",
- "\n",
- "
\n",
- " \n",
- " \n",
- " \n",
- " Code \n",
- " Date \n",
- " Open \n",
- " High \n",
- " Low \n",
- " Close \n",
- " Volume \n",
- " TurnoverValue \n",
- " AdjustmentFactor \n",
- " AdjustmentOpen \n",
- " AdjustmentHigh \n",
- " AdjustmentLow \n",
- " AdjustmentClose \n",
- " AdjustmentVolume \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " 8 \n",
- " 13190 \n",
- " 2022-08-01 \n",
- " NaN \n",
- " NaN \n",
- " NaN \n",
- " NaN \n",
- " NaN \n",
- " NaN \n",
- " 1.0 \n",
- " NaN \n",
- " NaN \n",
- " NaN \n",
- " NaN \n",
- " NaN \n",
- " \n",
- " \n",
- " 12 \n",
- " 13240 \n",
- " 2022-08-01 \n",
- " NaN \n",
- " NaN \n",
- " NaN \n",
- " NaN \n",
- " NaN \n",
- " NaN \n",
- " 1.0 \n",
- " NaN \n",
- " NaN \n",
- " NaN \n",
- " NaN \n",
- " NaN \n",
- " \n",
- " \n",
- " 46 \n",
- " 13870 \n",
- " 2022-08-01 \n",
- " NaN \n",
- " NaN \n",
- " NaN \n",
- " NaN \n",
- " NaN \n",
- " NaN \n",
- " 1.0 \n",
- " NaN \n",
- " NaN \n",
- " NaN \n",
- " NaN \n",
- " NaN \n",
- " \n",
- " \n",
- " 54 \n",
- " 13970 \n",
- " 2022-08-01 \n",
- " NaN \n",
- " NaN \n",
- " NaN \n",
- " NaN \n",
- " NaN \n",
- " NaN \n",
- " 1.0 \n",
- " NaN \n",
- " NaN \n",
- " NaN \n",
- " NaN \n",
- " NaN \n",
- " \n",
- " \n",
- " 68 \n",
- " 14320 \n",
- " 2022-08-01 \n",
- " NaN \n",
- " NaN \n",
- " NaN \n",
- " NaN \n",
- " NaN \n",
- " NaN \n",
- " 1.0 \n",
- " NaN \n",
- " NaN \n",
- " NaN \n",
- " NaN \n",
- " NaN \n",
- " \n",
- " \n",
- " ... \n",
- " ... \n",
- " ... \n",
- " ... \n",
- " ... \n",
- " ... \n",
- " ... \n",
- " ... \n",
- " ... \n",
- " ... \n",
- " ... \n",
- " ... \n",
- " ... \n",
- " ... \n",
- " ... \n",
- " \n",
- " \n",
- " 4064 \n",
- " 97200 \n",
- " 2022-08-01 \n",
- " NaN \n",
- " NaN \n",
- " NaN \n",
- " NaN \n",
- " NaN \n",
- " NaN \n",
- " 1.0 \n",
- " NaN \n",
- " NaN \n",
- " NaN \n",
- " NaN \n",
- " NaN \n",
- " \n",
- " \n",
- " 4095 \n",
- " 97800 \n",
- " 2022-08-01 \n",
- " NaN \n",
- " NaN \n",
- " NaN \n",
- " NaN \n",
- " NaN \n",
- " NaN \n",
- " 1.0 \n",
- " NaN \n",
- " NaN \n",
- " NaN \n",
- " NaN \n",
- " NaN \n",
- " \n",
- " \n",
- " 4129 \n",
- " 98570 \n",
- " 2022-08-01 \n",
- " NaN \n",
- " NaN \n",
- " NaN \n",
- " NaN \n",
- " NaN \n",
- " NaN \n",
- " 1.0 \n",
- " NaN \n",
- " NaN \n",
- " NaN \n",
- " NaN \n",
- " NaN \n",
- " \n",
- " \n",
- " 4173 \n",
- " 99670 \n",
- " 2022-08-01 \n",
- " NaN \n",
- " NaN \n",
- " NaN \n",
- " NaN \n",
- " NaN \n",
- " NaN \n",
- " 1.0 \n",
- " NaN \n",
- " NaN \n",
- " NaN \n",
- " NaN \n",
- " NaN \n",
- " \n",
- " \n",
- " 4178 \n",
- " 99760 \n",
- " 2022-08-01 \n",
- " NaN \n",
- " NaN \n",
- " NaN \n",
- " NaN \n",
- " NaN \n",
- " NaN \n",
- " 1.0 \n",
- " NaN \n",
- " NaN \n",
- " NaN \n",
- " NaN \n",
- " NaN \n",
- " \n",
- " \n",
- "
\n",
- "
129 rows × 14 columns
\n",
- "
\n",
- "
\n",
- " \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " \n",
- "\n",
- " \n",
- "
\n",
- "
\n",
- " "
- ]
- },
- "metadata": {},
- "execution_count": 20
- }
- ]
+ "execution_count": null,
+ "outputs": []
},
{
"cell_type": "markdown",
@@ -3589,628 +614,6 @@
"id": "gQNAyN8mrxf2"
}
},
- {
- "cell_type": "markdown",
- "source": [
- "- 株価情報APIは、`code`を指定していれば、`from`, `to`でのデータ取得も可能です。"
- ],
- "metadata": {
- "id": "ViuGOQrysAFv"
- }
- },
- {
- "cell_type": "code",
- "source": [
- "# JPXの株式について2022年8月1日から9月1日までのデータを取得\n",
- "cli.get_prices_daily_quotes(code=86970,\n",
- " from_yyyymmdd=20220801,\n",
- " to_yyyymmdd=20220901)\n"
- ],
- "metadata": {
- "colab": {
- "base_uri": "https://localhost:8080/",
- "height": 0
- },
- "id": "94WZ-iifsiXT",
- "outputId": "2a57dcf8-514f-4520-d0b2-270b10cd17c2"
- },
- "execution_count": 21,
- "outputs": [
- {
- "output_type": "execute_result",
- "data": {
- "text/plain": [
- " Code Date Open High Low Close Volume \\\n",
- "0 86970 2022-08-01 2115.5 2144.0 2097.0 2143.5 945400.0 \n",
- "1 86970 2022-08-02 2132.0 2136.0 2099.0 2102.5 857200.0 \n",
- "2 86970 2022-08-03 2125.0 2143.5 2121.5 2129.0 941200.0 \n",
- "3 86970 2022-08-04 2142.0 2142.5 2125.0 2138.0 691500.0 \n",
- "4 86970 2022-08-05 2150.0 2171.0 2146.0 2164.5 775400.0 \n",
- "5 86970 2022-08-08 2166.0 2174.0 2155.5 2171.5 712700.0 \n",
- "6 86970 2022-08-09 2175.5 2181.5 2147.5 2155.0 757300.0 \n",
- "7 86970 2022-08-10 2161.5 2169.5 2136.5 2147.0 676800.0 \n",
- "8 86970 2022-08-12 2208.5 2209.0 2162.5 2172.0 1649500.0 \n",
- "9 86970 2022-08-15 2173.0 2193.5 2164.0 2191.5 645700.0 \n",
- "10 86970 2022-08-16 2197.0 2200.5 2178.0 2182.0 684500.0 \n",
- "11 86970 2022-08-17 2198.0 2226.5 2195.0 2223.5 994900.0 \n",
- "12 86970 2022-08-18 2220.5 2224.5 2191.5 2200.0 816400.0 \n",
- "13 86970 2022-08-19 2206.0 2206.5 2169.0 2171.5 828800.0 \n",
- "14 86970 2022-08-22 2154.0 2165.5 2146.0 2161.5 577800.0 \n",
- "15 86970 2022-08-23 2142.5 2155.5 2125.5 2146.0 725600.0 \n",
- "16 86970 2022-08-24 2149.0 2150.0 2134.0 2144.0 620500.0 \n",
- "17 86970 2022-08-25 2167.0 2181.0 2157.5 2170.0 797000.0 \n",
- "18 86970 2022-08-26 2189.5 2191.0 2161.5 2163.5 536900.0 \n",
- "19 86970 2022-08-29 2118.0 2120.0 2071.0 2072.0 1540500.0 \n",
- "20 86970 2022-08-30 2092.5 2115.0 2084.0 2107.5 914000.0 \n",
- "21 86970 2022-08-31 2081.5 2095.0 2077.0 2084.5 1166200.0 \n",
- "22 86970 2022-09-01 2052.0 2064.0 2033.0 2059.0 1192300.0 \n",
- "\n",
- " TurnoverValue AdjustmentFactor AdjustmentOpen AdjustmentHigh \\\n",
- "0 2.016768e+09 1.0 2115.5 2144.0 \n",
- "1 1.807583e+09 1.0 2132.0 2136.0 \n",
- "2 2.004944e+09 1.0 2125.0 2143.5 \n",
- "3 1.477278e+09 1.0 2142.0 2142.5 \n",
- "4 1.676780e+09 1.0 2150.0 2171.0 \n",
- "5 1.544867e+09 1.0 2166.0 2174.0 \n",
- "6 1.636470e+09 1.0 2175.5 2181.5 \n",
- "7 1.453722e+09 1.0 2161.5 2169.5 \n",
- "8 3.602564e+09 1.0 2208.5 2209.0 \n",
- "9 1.410109e+09 1.0 2173.0 2193.5 \n",
- "10 1.495720e+09 1.0 2197.0 2200.5 \n",
- "11 2.207119e+09 1.0 2198.0 2226.5 \n",
- "12 1.798841e+09 1.0 2220.5 2224.5 \n",
- "13 1.805492e+09 1.0 2206.0 2206.5 \n",
- "14 1.247047e+09 1.0 2154.0 2165.5 \n",
- "15 1.555905e+09 1.0 2142.5 2155.5 \n",
- "16 1.330035e+09 1.0 2149.0 2150.0 \n",
- "17 1.730139e+09 1.0 2167.0 2181.0 \n",
- "18 1.165411e+09 1.0 2189.5 2191.0 \n",
- "19 3.211936e+09 1.0 2118.0 2120.0 \n",
- "20 1.922998e+09 1.0 2092.5 2115.0 \n",
- "21 2.431587e+09 1.0 2081.5 2095.0 \n",
- "22 2.448594e+09 1.0 2052.0 2064.0 \n",
- "\n",
- " AdjustmentLow AdjustmentClose AdjustmentVolume \n",
- "0 2097.0 2143.5 945400.0 \n",
- "1 2099.0 2102.5 857200.0 \n",
- "2 2121.5 2129.0 941200.0 \n",
- "3 2125.0 2138.0 691500.0 \n",
- "4 2146.0 2164.5 775400.0 \n",
- "5 2155.5 2171.5 712700.0 \n",
- "6 2147.5 2155.0 757300.0 \n",
- "7 2136.5 2147.0 676800.0 \n",
- "8 2162.5 2172.0 1649500.0 \n",
- "9 2164.0 2191.5 645700.0 \n",
- "10 2178.0 2182.0 684500.0 \n",
- "11 2195.0 2223.5 994900.0 \n",
- "12 2191.5 2200.0 816400.0 \n",
- "13 2169.0 2171.5 828800.0 \n",
- "14 2146.0 2161.5 577800.0 \n",
- "15 2125.5 2146.0 725600.0 \n",
- "16 2134.0 2144.0 620500.0 \n",
- "17 2157.5 2170.0 797000.0 \n",
- "18 2161.5 2163.5 536900.0 \n",
- "19 2071.0 2072.0 1540500.0 \n",
- "20 2084.0 2107.5 914000.0 \n",
- "21 2077.0 2084.5 1166200.0 \n",
- "22 2033.0 2059.0 1192300.0 "
- ],
- "text/html": [
- "\n",
- " \n",
- "
\n",
- "
\n",
- "\n",
- "
\n",
- " \n",
- " \n",
- " \n",
- " Code \n",
- " Date \n",
- " Open \n",
- " High \n",
- " Low \n",
- " Close \n",
- " Volume \n",
- " TurnoverValue \n",
- " AdjustmentFactor \n",
- " AdjustmentOpen \n",
- " AdjustmentHigh \n",
- " AdjustmentLow \n",
- " AdjustmentClose \n",
- " AdjustmentVolume \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " 0 \n",
- " 86970 \n",
- " 2022-08-01 \n",
- " 2115.5 \n",
- " 2144.0 \n",
- " 2097.0 \n",
- " 2143.5 \n",
- " 945400.0 \n",
- " 2.016768e+09 \n",
- " 1.0 \n",
- " 2115.5 \n",
- " 2144.0 \n",
- " 2097.0 \n",
- " 2143.5 \n",
- " 945400.0 \n",
- " \n",
- " \n",
- " 1 \n",
- " 86970 \n",
- " 2022-08-02 \n",
- " 2132.0 \n",
- " 2136.0 \n",
- " 2099.0 \n",
- " 2102.5 \n",
- " 857200.0 \n",
- " 1.807583e+09 \n",
- " 1.0 \n",
- " 2132.0 \n",
- " 2136.0 \n",
- " 2099.0 \n",
- " 2102.5 \n",
- " 857200.0 \n",
- " \n",
- " \n",
- " 2 \n",
- " 86970 \n",
- " 2022-08-03 \n",
- " 2125.0 \n",
- " 2143.5 \n",
- " 2121.5 \n",
- " 2129.0 \n",
- " 941200.0 \n",
- " 2.004944e+09 \n",
- " 1.0 \n",
- " 2125.0 \n",
- " 2143.5 \n",
- " 2121.5 \n",
- " 2129.0 \n",
- " 941200.0 \n",
- " \n",
- " \n",
- " 3 \n",
- " 86970 \n",
- " 2022-08-04 \n",
- " 2142.0 \n",
- " 2142.5 \n",
- " 2125.0 \n",
- " 2138.0 \n",
- " 691500.0 \n",
- " 1.477278e+09 \n",
- " 1.0 \n",
- " 2142.0 \n",
- " 2142.5 \n",
- " 2125.0 \n",
- " 2138.0 \n",
- " 691500.0 \n",
- " \n",
- " \n",
- " 4 \n",
- " 86970 \n",
- " 2022-08-05 \n",
- " 2150.0 \n",
- " 2171.0 \n",
- " 2146.0 \n",
- " 2164.5 \n",
- " 775400.0 \n",
- " 1.676780e+09 \n",
- " 1.0 \n",
- " 2150.0 \n",
- " 2171.0 \n",
- " 2146.0 \n",
- " 2164.5 \n",
- " 775400.0 \n",
- " \n",
- " \n",
- " 5 \n",
- " 86970 \n",
- " 2022-08-08 \n",
- " 2166.0 \n",
- " 2174.0 \n",
- " 2155.5 \n",
- " 2171.5 \n",
- " 712700.0 \n",
- " 1.544867e+09 \n",
- " 1.0 \n",
- " 2166.0 \n",
- " 2174.0 \n",
- " 2155.5 \n",
- " 2171.5 \n",
- " 712700.0 \n",
- " \n",
- " \n",
- " 6 \n",
- " 86970 \n",
- " 2022-08-09 \n",
- " 2175.5 \n",
- " 2181.5 \n",
- " 2147.5 \n",
- " 2155.0 \n",
- " 757300.0 \n",
- " 1.636470e+09 \n",
- " 1.0 \n",
- " 2175.5 \n",
- " 2181.5 \n",
- " 2147.5 \n",
- " 2155.0 \n",
- " 757300.0 \n",
- " \n",
- " \n",
- " 7 \n",
- " 86970 \n",
- " 2022-08-10 \n",
- " 2161.5 \n",
- " 2169.5 \n",
- " 2136.5 \n",
- " 2147.0 \n",
- " 676800.0 \n",
- " 1.453722e+09 \n",
- " 1.0 \n",
- " 2161.5 \n",
- " 2169.5 \n",
- " 2136.5 \n",
- " 2147.0 \n",
- " 676800.0 \n",
- " \n",
- " \n",
- " 8 \n",
- " 86970 \n",
- " 2022-08-12 \n",
- " 2208.5 \n",
- " 2209.0 \n",
- " 2162.5 \n",
- " 2172.0 \n",
- " 1649500.0 \n",
- " 3.602564e+09 \n",
- " 1.0 \n",
- " 2208.5 \n",
- " 2209.0 \n",
- " 2162.5 \n",
- " 2172.0 \n",
- " 1649500.0 \n",
- " \n",
- " \n",
- " 9 \n",
- " 86970 \n",
- " 2022-08-15 \n",
- " 2173.0 \n",
- " 2193.5 \n",
- " 2164.0 \n",
- " 2191.5 \n",
- " 645700.0 \n",
- " 1.410109e+09 \n",
- " 1.0 \n",
- " 2173.0 \n",
- " 2193.5 \n",
- " 2164.0 \n",
- " 2191.5 \n",
- " 645700.0 \n",
- " \n",
- " \n",
- " 10 \n",
- " 86970 \n",
- " 2022-08-16 \n",
- " 2197.0 \n",
- " 2200.5 \n",
- " 2178.0 \n",
- " 2182.0 \n",
- " 684500.0 \n",
- " 1.495720e+09 \n",
- " 1.0 \n",
- " 2197.0 \n",
- " 2200.5 \n",
- " 2178.0 \n",
- " 2182.0 \n",
- " 684500.0 \n",
- " \n",
- " \n",
- " 11 \n",
- " 86970 \n",
- " 2022-08-17 \n",
- " 2198.0 \n",
- " 2226.5 \n",
- " 2195.0 \n",
- " 2223.5 \n",
- " 994900.0 \n",
- " 2.207119e+09 \n",
- " 1.0 \n",
- " 2198.0 \n",
- " 2226.5 \n",
- " 2195.0 \n",
- " 2223.5 \n",
- " 994900.0 \n",
- " \n",
- " \n",
- " 12 \n",
- " 86970 \n",
- " 2022-08-18 \n",
- " 2220.5 \n",
- " 2224.5 \n",
- " 2191.5 \n",
- " 2200.0 \n",
- " 816400.0 \n",
- " 1.798841e+09 \n",
- " 1.0 \n",
- " 2220.5 \n",
- " 2224.5 \n",
- " 2191.5 \n",
- " 2200.0 \n",
- " 816400.0 \n",
- " \n",
- " \n",
- " 13 \n",
- " 86970 \n",
- " 2022-08-19 \n",
- " 2206.0 \n",
- " 2206.5 \n",
- " 2169.0 \n",
- " 2171.5 \n",
- " 828800.0 \n",
- " 1.805492e+09 \n",
- " 1.0 \n",
- " 2206.0 \n",
- " 2206.5 \n",
- " 2169.0 \n",
- " 2171.5 \n",
- " 828800.0 \n",
- " \n",
- " \n",
- " 14 \n",
- " 86970 \n",
- " 2022-08-22 \n",
- " 2154.0 \n",
- " 2165.5 \n",
- " 2146.0 \n",
- " 2161.5 \n",
- " 577800.0 \n",
- " 1.247047e+09 \n",
- " 1.0 \n",
- " 2154.0 \n",
- " 2165.5 \n",
- " 2146.0 \n",
- " 2161.5 \n",
- " 577800.0 \n",
- " \n",
- " \n",
- " 15 \n",
- " 86970 \n",
- " 2022-08-23 \n",
- " 2142.5 \n",
- " 2155.5 \n",
- " 2125.5 \n",
- " 2146.0 \n",
- " 725600.0 \n",
- " 1.555905e+09 \n",
- " 1.0 \n",
- " 2142.5 \n",
- " 2155.5 \n",
- " 2125.5 \n",
- " 2146.0 \n",
- " 725600.0 \n",
- " \n",
- " \n",
- " 16 \n",
- " 86970 \n",
- " 2022-08-24 \n",
- " 2149.0 \n",
- " 2150.0 \n",
- " 2134.0 \n",
- " 2144.0 \n",
- " 620500.0 \n",
- " 1.330035e+09 \n",
- " 1.0 \n",
- " 2149.0 \n",
- " 2150.0 \n",
- " 2134.0 \n",
- " 2144.0 \n",
- " 620500.0 \n",
- " \n",
- " \n",
- " 17 \n",
- " 86970 \n",
- " 2022-08-25 \n",
- " 2167.0 \n",
- " 2181.0 \n",
- " 2157.5 \n",
- " 2170.0 \n",
- " 797000.0 \n",
- " 1.730139e+09 \n",
- " 1.0 \n",
- " 2167.0 \n",
- " 2181.0 \n",
- " 2157.5 \n",
- " 2170.0 \n",
- " 797000.0 \n",
- " \n",
- " \n",
- " 18 \n",
- " 86970 \n",
- " 2022-08-26 \n",
- " 2189.5 \n",
- " 2191.0 \n",
- " 2161.5 \n",
- " 2163.5 \n",
- " 536900.0 \n",
- " 1.165411e+09 \n",
- " 1.0 \n",
- " 2189.5 \n",
- " 2191.0 \n",
- " 2161.5 \n",
- " 2163.5 \n",
- " 536900.0 \n",
- " \n",
- " \n",
- " 19 \n",
- " 86970 \n",
- " 2022-08-29 \n",
- " 2118.0 \n",
- " 2120.0 \n",
- " 2071.0 \n",
- " 2072.0 \n",
- " 1540500.0 \n",
- " 3.211936e+09 \n",
- " 1.0 \n",
- " 2118.0 \n",
- " 2120.0 \n",
- " 2071.0 \n",
- " 2072.0 \n",
- " 1540500.0 \n",
- " \n",
- " \n",
- " 20 \n",
- " 86970 \n",
- " 2022-08-30 \n",
- " 2092.5 \n",
- " 2115.0 \n",
- " 2084.0 \n",
- " 2107.5 \n",
- " 914000.0 \n",
- " 1.922998e+09 \n",
- " 1.0 \n",
- " 2092.5 \n",
- " 2115.0 \n",
- " 2084.0 \n",
- " 2107.5 \n",
- " 914000.0 \n",
- " \n",
- " \n",
- " 21 \n",
- " 86970 \n",
- " 2022-08-31 \n",
- " 2081.5 \n",
- " 2095.0 \n",
- " 2077.0 \n",
- " 2084.5 \n",
- " 1166200.0 \n",
- " 2.431587e+09 \n",
- " 1.0 \n",
- " 2081.5 \n",
- " 2095.0 \n",
- " 2077.0 \n",
- " 2084.5 \n",
- " 1166200.0 \n",
- " \n",
- " \n",
- " 22 \n",
- " 86970 \n",
- " 2022-09-01 \n",
- " 2052.0 \n",
- " 2064.0 \n",
- " 2033.0 \n",
- " 2059.0 \n",
- " 1192300.0 \n",
- " 2.448594e+09 \n",
- " 1.0 \n",
- " 2052.0 \n",
- " 2064.0 \n",
- " 2033.0 \n",
- " 2059.0 \n",
- " 1192300.0 \n",
- " \n",
- " \n",
- "
\n",
- "
\n",
- "
\n",
- " \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " \n",
- "\n",
- " \n",
- "
\n",
- "
\n",
- " "
- ]
- },
- "metadata": {},
- "execution_count": 21
- }
- ]
- },
{
"cell_type": "markdown",
"source": [
@@ -4223,376 +626,16 @@
{
"cell_type": "code",
"source": [
- "df_quotes = cli.get_price_range(start_dt=\"20220801\", end_dt=\"20220831\")\n",
+ "d_from = datetime.now() - timedelta(days=365)\n",
+ "d_to = datetime.now() - timedelta(days=335)\n",
+ "df_quotes = cli.get_price_range(start_dt=d_from.strftime(format=\"%Y%m%d\"), end_dt=d_to.strftime(format=\"%Y%m%d\"))\n",
"df_quotes\n"
],
"metadata": {
- "colab": {
- "base_uri": "https://localhost:8080/",
- "height": 0
- },
- "id": "Mwz8uApUxm-E",
- "outputId": "fa5158ec-223d-45cc-c2b6-697cf386410d"
+ "id": "Mwz8uApUxm-E"
},
- "execution_count": 22,
- "outputs": [
- {
- "output_type": "execute_result",
- "data": {
- "text/plain": [
- " Code Date Open High Low Close Volume \\\n",
- "0 13010 2022-08-01 3630.0 3650.0 3615.0 3650.0 10600.0 \n",
- "0 13010 2022-08-02 3650.0 3650.0 3610.0 3615.0 9200.0 \n",
- "0 13010 2022-08-03 3600.0 3600.0 3570.0 3575.0 10600.0 \n",
- "0 13010 2022-08-04 3600.0 3600.0 3505.0 3525.0 14500.0 \n",
- "0 13010 2022-08-05 3510.0 3750.0 3510.0 3675.0 66900.0 \n",
- "... ... ... ... ... ... ... ... \n",
- "4194 99970 2022-08-25 745.0 752.0 738.0 748.0 163600.0 \n",
- "4194 99970 2022-08-26 749.0 756.0 749.0 752.0 161100.0 \n",
- "4193 99970 2022-08-29 737.0 745.0 735.0 742.0 134700.0 \n",
- "4191 99970 2022-08-30 747.0 751.0 743.0 750.0 134600.0 \n",
- "4191 99970 2022-08-31 742.0 746.0 735.0 740.0 204700.0 \n",
- "\n",
- " TurnoverValue AdjustmentFactor AdjustmentOpen AdjustmentHigh \\\n",
- "0 38604500.0 1.0 3630.0 3650.0 \n",
- "0 33328500.0 1.0 3650.0 3650.0 \n",
- "0 37995500.0 1.0 3600.0 3600.0 \n",
- "0 51253500.0 1.0 3600.0 3600.0 \n",
- "0 245070500.0 1.0 3510.0 3750.0 \n",
- "... ... ... ... ... \n",
- "4194 122059300.0 1.0 745.0 752.0 \n",
- "4194 121237800.0 1.0 749.0 756.0 \n",
- "4193 99769600.0 1.0 737.0 745.0 \n",
- "4191 100634800.0 1.0 747.0 751.0 \n",
- "4191 151454400.0 1.0 742.0 746.0 \n",
- "\n",
- " AdjustmentLow AdjustmentClose AdjustmentVolume \n",
- "0 3615.0 3650.0 10600.0 \n",
- "0 3610.0 3615.0 9200.0 \n",
- "0 3570.0 3575.0 10600.0 \n",
- "0 3505.0 3525.0 14500.0 \n",
- "0 3510.0 3675.0 66900.0 \n",
- "... ... ... ... \n",
- "4194 738.0 748.0 163600.0 \n",
- "4194 749.0 752.0 161100.0 \n",
- "4193 735.0 742.0 134700.0 \n",
- "4191 743.0 750.0 134600.0 \n",
- "4191 735.0 740.0 204700.0 \n",
- "\n",
- "[92324 rows x 14 columns]"
- ],
- "text/html": [
- "\n",
- " \n",
- "
\n",
- "
\n",
- "\n",
- "
\n",
- " \n",
- " \n",
- " \n",
- " Code \n",
- " Date \n",
- " Open \n",
- " High \n",
- " Low \n",
- " Close \n",
- " Volume \n",
- " TurnoverValue \n",
- " AdjustmentFactor \n",
- " AdjustmentOpen \n",
- " AdjustmentHigh \n",
- " AdjustmentLow \n",
- " AdjustmentClose \n",
- " AdjustmentVolume \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " 0 \n",
- " 13010 \n",
- " 2022-08-01 \n",
- " 3630.0 \n",
- " 3650.0 \n",
- " 3615.0 \n",
- " 3650.0 \n",
- " 10600.0 \n",
- " 38604500.0 \n",
- " 1.0 \n",
- " 3630.0 \n",
- " 3650.0 \n",
- " 3615.0 \n",
- " 3650.0 \n",
- " 10600.0 \n",
- " \n",
- " \n",
- " 0 \n",
- " 13010 \n",
- " 2022-08-02 \n",
- " 3650.0 \n",
- " 3650.0 \n",
- " 3610.0 \n",
- " 3615.0 \n",
- " 9200.0 \n",
- " 33328500.0 \n",
- " 1.0 \n",
- " 3650.0 \n",
- " 3650.0 \n",
- " 3610.0 \n",
- " 3615.0 \n",
- " 9200.0 \n",
- " \n",
- " \n",
- " 0 \n",
- " 13010 \n",
- " 2022-08-03 \n",
- " 3600.0 \n",
- " 3600.0 \n",
- " 3570.0 \n",
- " 3575.0 \n",
- " 10600.0 \n",
- " 37995500.0 \n",
- " 1.0 \n",
- " 3600.0 \n",
- " 3600.0 \n",
- " 3570.0 \n",
- " 3575.0 \n",
- " 10600.0 \n",
- " \n",
- " \n",
- " 0 \n",
- " 13010 \n",
- " 2022-08-04 \n",
- " 3600.0 \n",
- " 3600.0 \n",
- " 3505.0 \n",
- " 3525.0 \n",
- " 14500.0 \n",
- " 51253500.0 \n",
- " 1.0 \n",
- " 3600.0 \n",
- " 3600.0 \n",
- " 3505.0 \n",
- " 3525.0 \n",
- " 14500.0 \n",
- " \n",
- " \n",
- " 0 \n",
- " 13010 \n",
- " 2022-08-05 \n",
- " 3510.0 \n",
- " 3750.0 \n",
- " 3510.0 \n",
- " 3675.0 \n",
- " 66900.0 \n",
- " 245070500.0 \n",
- " 1.0 \n",
- " 3510.0 \n",
- " 3750.0 \n",
- " 3510.0 \n",
- " 3675.0 \n",
- " 66900.0 \n",
- " \n",
- " \n",
- " ... \n",
- " ... \n",
- " ... \n",
- " ... \n",
- " ... \n",
- " ... \n",
- " ... \n",
- " ... \n",
- " ... \n",
- " ... \n",
- " ... \n",
- " ... \n",
- " ... \n",
- " ... \n",
- " ... \n",
- " \n",
- " \n",
- " 4194 \n",
- " 99970 \n",
- " 2022-08-25 \n",
- " 745.0 \n",
- " 752.0 \n",
- " 738.0 \n",
- " 748.0 \n",
- " 163600.0 \n",
- " 122059300.0 \n",
- " 1.0 \n",
- " 745.0 \n",
- " 752.0 \n",
- " 738.0 \n",
- " 748.0 \n",
- " 163600.0 \n",
- " \n",
- " \n",
- " 4194 \n",
- " 99970 \n",
- " 2022-08-26 \n",
- " 749.0 \n",
- " 756.0 \n",
- " 749.0 \n",
- " 752.0 \n",
- " 161100.0 \n",
- " 121237800.0 \n",
- " 1.0 \n",
- " 749.0 \n",
- " 756.0 \n",
- " 749.0 \n",
- " 752.0 \n",
- " 161100.0 \n",
- " \n",
- " \n",
- " 4193 \n",
- " 99970 \n",
- " 2022-08-29 \n",
- " 737.0 \n",
- " 745.0 \n",
- " 735.0 \n",
- " 742.0 \n",
- " 134700.0 \n",
- " 99769600.0 \n",
- " 1.0 \n",
- " 737.0 \n",
- " 745.0 \n",
- " 735.0 \n",
- " 742.0 \n",
- " 134700.0 \n",
- " \n",
- " \n",
- " 4191 \n",
- " 99970 \n",
- " 2022-08-30 \n",
- " 747.0 \n",
- " 751.0 \n",
- " 743.0 \n",
- " 750.0 \n",
- " 134600.0 \n",
- " 100634800.0 \n",
- " 1.0 \n",
- " 747.0 \n",
- " 751.0 \n",
- " 743.0 \n",
- " 750.0 \n",
- " 134600.0 \n",
- " \n",
- " \n",
- " 4191 \n",
- " 99970 \n",
- " 2022-08-31 \n",
- " 742.0 \n",
- " 746.0 \n",
- " 735.0 \n",
- " 740.0 \n",
- " 204700.0 \n",
- " 151454400.0 \n",
- " 1.0 \n",
- " 742.0 \n",
- " 746.0 \n",
- " 735.0 \n",
- " 740.0 \n",
- " 204700.0 \n",
- " \n",
- " \n",
- "
\n",
- "
92324 rows × 14 columns
\n",
- "
\n",
- "
\n",
- " \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " \n",
- "\n",
- " \n",
- "
\n",
- "
\n",
- " "
- ]
- },
- "metadata": {},
- "execution_count": 22
- }
- ]
+ "execution_count": null,
+ "outputs": []
},
{
"cell_type": "markdown",
@@ -4615,7 +658,7 @@
{
"cell_type": "code",
"source": [
- "# JPXの2017年からの株価を取得\n",
+ "# JPXの株価を取得\n",
"df_jpx = cli.get_prices_daily_quotes(code=8697)\n",
"\n",
"# グラフに第2軸を設定\n",
@@ -4649,125 +692,22 @@
"fig.show()\n"
],
"metadata": {
- "colab": {
- "base_uri": "https://localhost:8080/",
- "height": 0
- },
- "id": "0qS4NGdYyeI0",
- "outputId": "8643be4c-2083-4c24-c973-0ed298a02d18"
+ "id": "0qS4NGdYyeI0"
},
- "execution_count": 23,
- "outputs": [
- {
- "output_type": "display_data",
- "data": {
- "text/html": [
- "\n",
- " \n",
- "\n",
- " \n",
- "\n",
- ""
- ]
- },
- "metadata": {}
- }
- ]
+ "execution_count": null,
+ "outputs": []
},
{
"cell_type": "markdown",
"source": [
"# 財務情報 API(18時ごろ及び24時30分頃更新)\n",
- "(注)2022/11/25時点の情報です。\n",
"\n",
- "財務情報は、2017年から直近までの上場会社の四半期及び通期の決算短信に係る情報を取得できます。"
+ "財務情報は上場会社の四半期及び通期の決算短信に係る情報を取得できます。"
],
"metadata": {
"id": "9Ox2YvyjY_p8"
}
},
- {
- "cell_type": "markdown",
- "source": [
- "## API出力データ概要\n",
- "\n",
- "\n",
- "|変数名|概要|\n",
- "|---|---|\n",
- "|DisclosureNumber|適時開示番号(TDnet内で一意になるコード)|\n",
- "|DisclosedDate|適時開示された日|\n",
- "|ApplyingOfSpecificAccountingOfTheQuarterlyFinancialStatements|四半期財務諸表の作成に特有の会計処理の適用|\n",
- "|AverageNumberOfShares|会計期中の平均株式数|\n",
- "|BookValuePerShare|一株あたりの純資産|\n",
- "|ChangesBasedOnRevisionsOfAccountingStandard|会計基準等の改正に伴う会計方針の変更|\n",
- "|ChangesInAccountingEstimates|会計上の見積りの変更\n",
- "|\n",
- "|ChangesOtherThanOnesBasedOnRevisionsOfAccountingStandard|会計基準等の改正に伴う変更以外の会計方針の変更|\n",
- "|CurrentFiscalYearEndDate|当事業年度終了日|\n",
- "|CurrentFiscalYearStartDate|当事業年度開始日|\n",
- "|CurrentPeriodEndDate|当会計期間終了日|\n",
- "|DisclosedTime|開示時刻|\n",
- "|DisclosedUnixTime|開示UnixTime|\n",
- "|EarningsPerShare|1株当たり当期純利益|\n",
- "|Equity|純資産|\n",
- "|EquityToAssetRatio|自己資本比率|\n",
- "|ForecastDividendPerShare1stQuarter|第1四半期末の配当予想|\n",
- "|ForecastDividendPerShare2ndQuarter|第2四半期末の配当予想|\n",
- "|ForecastDividendPerShare3rdQuarter|第3四半期末の配当予想|\n",
- "|ForecastDividendPerShareAnnual|通期の配当予想の合計値|\n",
- "|ForecastDividendPerShareFiscalYearEnd|期末の配当予想|\n",
- "|ForecastEarningsPerShare|1株当たり当期純利益の通期予想|\n",
- "|ForecastNetSales|売上高_通期予想|\n",
- "|ForecastOperatingProfit|営業利益_通期予想|\n",
- "|ForecastOrdinaryProfit|経常利益_通期予想|\n",
- "|ForecastProfit|当期純利益_通期予想|\n",
- "|LocalCode|株式銘柄コード|\n",
- "|MaterialChangesInSubsidiaries|期中における重要な子会社の異動|\n",
- "|NetSales|売上高|\n",
- "|NumberOfIssuedAndOutstandingSharesAtTheEndOfFiscalYearIncludingTreasuryStock|期末発行済株式数|\n",
- "|NumberOfTreasuryStockAtTheEndOfFiscalYear|期末自己株式数|\n",
- "|OperatingProfit|営業利益|\n",
- "|OrdinaryProfit|経常利益|\n",
- "|Profit|当期純利益|\n",
- "|ResultDividendPerShare1stQuarter|第1四半期末の配当実績|\n",
- "|ResultDividendPerShare2ndQuarter|第2四半期末の配当実績|\n",
- "|ResultDividendPerShare3rdQuarter|第3四半期末の配当実績|\n",
- "|ResultDividendPerShareAnnual|通期の配当実績の合計|\n",
- "|ResultDividendPerShareFiscalYearEnd|期末の配当実績|\n",
- "|RetrospectiveRestatement|修正再表示|\n",
- "|TotalAssets|総資産|\n",
- "|TypeOfCurrentPeriod|当会計期間の種類|\n",
- "|TypeOfDocument|書類種別|\n"
- ],
- "metadata": {
- "id": "29fGKAttno-E"
- }
- },
{
"cell_type": "code",
"source": [
@@ -4782,2250 +722,10 @@
"df_fins\n"
],
"metadata": {
- "colab": {
- "base_uri": "https://localhost:8080/",
- "height": 0
- },
- "id": "MCF7Vh166U7O",
- "outputId": "73e28af8-b3d1-4c52-90ed-237c6b4c752f"
+ "id": "MCF7Vh166U7O"
},
- "execution_count": 24,
- "outputs": [
- {
- "output_type": "stream",
- "name": "stdout",
- "text": [
- "\n",
- "Int64Index: 30 entries, 0 to 29\n",
- "Data columns (total 43 columns):\n",
- " # Column Non-Null Count Dtype \n",
- "--- ------ -------------- ----- \n",
- " 0 DisclosureNumber 30 non-null object \n",
- " 1 DisclosedDate 30 non-null datetime64[ns]\n",
- " 2 ApplyingOfSpecificAccountingOfTheQuarterlyFinancialStatements 30 non-null object \n",
- " 3 AverageNumberOfShares 30 non-null object \n",
- " 4 BookValuePerShare 30 non-null object \n",
- " 5 ChangesBasedOnRevisionsOfAccountingStandard 30 non-null object \n",
- " 6 ChangesInAccountingEstimates 30 non-null object \n",
- " 7 ChangesOtherThanOnesBasedOnRevisionsOfAccountingStandard 30 non-null object \n",
- " 8 CurrentFiscalYearEndDate 30 non-null datetime64[ns]\n",
- " 9 CurrentFiscalYearStartDate 30 non-null datetime64[ns]\n",
- " 10 CurrentPeriodEndDate 30 non-null datetime64[ns]\n",
- " 11 DisclosedTime 30 non-null object \n",
- " 12 DisclosedUnixTime 30 non-null object \n",
- " 13 EarningsPerShare 30 non-null object \n",
- " 14 Equity 30 non-null object \n",
- " 15 EquityToAssetRatio 30 non-null object \n",
- " 16 ForecastDividendPerShare1stQuarter 30 non-null object \n",
- " 17 ForecastDividendPerShare2ndQuarter 30 non-null object \n",
- " 18 ForecastDividendPerShare3rdQuarter 30 non-null object \n",
- " 19 ForecastDividendPerShareAnnual 30 non-null object \n",
- " 20 ForecastDividendPerShareFiscalYearEnd 30 non-null object \n",
- " 21 ForecastEarningsPerShare 30 non-null object \n",
- " 22 ForecastNetSales 30 non-null object \n",
- " 23 ForecastOperatingProfit 30 non-null object \n",
- " 24 ForecastOrdinaryProfit 30 non-null object \n",
- " 25 ForecastProfit 30 non-null object \n",
- " 26 LocalCode 30 non-null object \n",
- " 27 MaterialChangesInSubsidiaries 30 non-null object \n",
- " 28 NetSales 30 non-null object \n",
- " 29 NumberOfIssuedAndOutstandingSharesAtTheEndOfFiscalYearIncludingTreasuryStock 30 non-null object \n",
- " 30 NumberOfTreasuryStockAtTheEndOfFiscalYear 30 non-null object \n",
- " 31 OperatingProfit 30 non-null object \n",
- " 32 OrdinaryProfit 30 non-null object \n",
- " 33 Profit 30 non-null object \n",
- " 34 ResultDividendPerShare1stQuarter 30 non-null object \n",
- " 35 ResultDividendPerShare2ndQuarter 30 non-null object \n",
- " 36 ResultDividendPerShare3rdQuarter 30 non-null object \n",
- " 37 ResultDividendPerShareAnnual 30 non-null object \n",
- " 38 ResultDividendPerShareFiscalYearEnd 30 non-null object \n",
- " 39 RetrospectiveRestatement 30 non-null object \n",
- " 40 TotalAssets 30 non-null object \n",
- " 41 TypeOfCurrentPeriod 30 non-null object \n",
- " 42 TypeOfDocument 30 non-null object \n",
- "dtypes: datetime64[ns](4), object(39)\n",
- "memory usage: 10.3+ KB\n",
- "\n",
- "\n"
- ]
- },
- {
- "output_type": "execute_result",
- "data": {
- "text/plain": [
- " DisclosureNumber DisclosedDate \\\n",
- "0 20170127483465 2017-01-30 \n",
- "1 20170321424149 2017-03-22 \n",
- "2 20170427453686 2017-04-28 \n",
- "3 20170727441140 2017-07-28 \n",
- "4 20171027401390 2017-10-30 \n",
- "5 20180130459766 2018-01-31 \n",
- "6 20180322494488 2018-03-22 \n",
- "7 20180426422269 2018-04-27 \n",
- "8 20180727486943 2018-07-30 \n",
- "9 20181026423739 2018-10-29 \n",
- "10 20190128464636 2019-01-29 \n",
- "11 20190425411956 2019-04-26 \n",
- "12 20190726476880 2019-07-30 \n",
- "13 20190920499881 2019-09-25 \n",
- "14 20191029414616 2019-10-30 \n",
- "15 20200129453073 2020-01-30 \n",
- "16 20200319481930 2020-03-23 \n",
- "17 20200429402226 2020-04-30 \n",
- "18 20200728468352 2020-07-29 \n",
- "19 20201027409944 2020-10-28 \n",
- "20 20210127450161 2021-01-28 \n",
- "21 20210319481454 2021-03-22 \n",
- "22 20210427402053 2021-04-28 \n",
- "23 20210727472046 2021-07-28 \n",
- "24 20211026416885 2021-10-27 \n",
- "25 20220126573026 2022-01-27 \n",
- "26 20220318508090 2022-03-22 \n",
- "27 20220425527054 2022-04-26 \n",
- "28 20220726504583 2022-07-27 \n",
- "29 20221026549969 2022-10-27 \n",
- "\n",
- " ApplyingOfSpecificAccountingOfTheQuarterlyFinancialStatements \\\n",
- "0 \n",
- "1 \n",
- "2 \n",
- "3 \n",
- "4 \n",
- "5 \n",
- "6 \n",
- "7 \n",
- "8 \n",
- "9 \n",
- "10 \n",
- "11 \n",
- "12 \n",
- "13 \n",
- "14 \n",
- "15 \n",
- "16 \n",
- "17 \n",
- "18 \n",
- "19 \n",
- "20 \n",
- "21 \n",
- "22 \n",
- "23 \n",
- "24 \n",
- "25 \n",
- "26 \n",
- "27 \n",
- "28 \n",
- "29 \n",
- "\n",
- " AverageNumberOfShares BookValuePerShare \\\n",
- "0 547924549 \n",
- "1 \n",
- "2 547051034 205.5 \n",
- "3 537208664 \n",
- "4 536483009 \n",
- "5 536242907 \n",
- "6 \n",
- "7 536125158 208.99 \n",
- "8 535766032 \n",
- "9 535725501 \n",
- "10 535693629 \n",
- "11 535678846 220.37 \n",
- "12 535522061 \n",
- "13 \n",
- "14 535480869 \n",
- "15 535467238 \n",
- "16 \n",
- "17 535464274 231.75 \n",
- "18 535342754 \n",
- "19 535311832 \n",
- "20 535301916 \n",
- "21 \n",
- "22 535304490 252.81 \n",
- "23 533875558 \n",
- "24 531421385 \n",
- "25 530119112 \n",
- "26 \n",
- "27 529487172 230.88 \n",
- "28 527204054 \n",
- "29 526953869 \n",
- "\n",
- " ChangesBasedOnRevisionsOfAccountingStandard ChangesInAccountingEstimates \\\n",
- "0 false false \n",
- "1 \n",
- "2 false false \n",
- "3 false false \n",
- "4 false false \n",
- "5 false false \n",
- "6 \n",
- "7 false false \n",
- "8 true false \n",
- "9 true false \n",
- "10 true false \n",
- "11 true false \n",
- "12 true false \n",
- "13 \n",
- "14 true true \n",
- "15 true true \n",
- "16 \n",
- "17 true true \n",
- "18 false false \n",
- "19 false false \n",
- "20 false false \n",
- "21 \n",
- "22 false false \n",
- "23 false false \n",
- "24 false false \n",
- "25 false false \n",
- "26 \n",
- "27 false false \n",
- "28 false false \n",
- "29 false true \n",
- "\n",
- " ChangesOtherThanOnesBasedOnRevisionsOfAccountingStandard \\\n",
- "0 false \n",
- "1 \n",
- "2 false \n",
- "3 false \n",
- "4 false \n",
- "5 false \n",
- "6 \n",
- "7 false \n",
- "8 false \n",
- "9 false \n",
- "10 false \n",
- "11 false \n",
- "12 false \n",
- "13 \n",
- "14 false \n",
- "15 false \n",
- "16 \n",
- "17 false \n",
- "18 false \n",
- "19 false \n",
- "20 false \n",
- "21 \n",
- "22 false \n",
- "23 false \n",
- "24 false \n",
- "25 false \n",
- "26 \n",
- "27 false \n",
- "28 false \n",
- "29 false \n",
- "\n",
- " CurrentFiscalYearEndDate CurrentFiscalYearStartDate CurrentPeriodEndDate \\\n",
- "0 2017-03-31 2016-04-01 2016-12-31 \n",
- "1 2017-03-31 2016-04-01 2017-03-31 \n",
- "2 2017-03-31 2016-04-01 2017-03-31 \n",
- "3 2018-03-31 2017-04-01 2017-06-30 \n",
- "4 2018-03-31 2017-04-01 2017-09-30 \n",
- "5 2018-03-31 2017-04-01 2017-12-31 \n",
- "6 2018-03-31 2017-04-01 2018-03-31 \n",
- "7 2018-03-31 2017-04-01 2018-03-31 \n",
- "8 2019-03-31 2018-04-01 2018-06-30 \n",
- "9 2019-03-31 2018-04-01 2018-09-30 \n",
- "10 2019-03-31 2018-04-01 2018-12-31 \n",
- "11 2019-03-31 2018-04-01 2019-03-31 \n",
- "12 2020-03-31 2019-04-01 2019-06-30 \n",
- "13 2020-03-31 2019-04-01 2020-03-31 \n",
- "14 2020-03-31 2019-04-01 2019-09-30 \n",
- "15 2020-03-31 2019-04-01 2019-12-31 \n",
- "16 2020-03-31 2019-04-01 2020-03-31 \n",
- "17 2020-03-31 2019-04-01 2020-03-31 \n",
- "18 2021-03-31 2020-04-01 2020-06-30 \n",
- "19 2021-03-31 2020-04-01 2020-09-30 \n",
- "20 2021-03-31 2020-04-01 2020-12-31 \n",
- "21 2021-03-31 2020-04-01 2021-03-31 \n",
- "22 2021-03-31 2020-04-01 2021-03-31 \n",
- "23 2022-03-31 2021-04-01 2021-06-30 \n",
- "24 2022-03-31 2021-04-01 2021-09-30 \n",
- "25 2022-03-31 2021-04-01 2021-12-31 \n",
- "26 2022-03-31 2021-04-01 2022-03-31 \n",
- "27 2022-03-31 2021-04-01 2022-03-31 \n",
- "28 2023-03-31 2022-04-01 2022-06-30 \n",
- "29 2023-03-31 2022-04-01 2022-09-30 \n",
- "\n",
- " DisclosedTime DisclosedUnixTime EarningsPerShare Equity \\\n",
- "0 12:00:00 1485745200.0 58.1 260297000000 \n",
- "1 14:00:00 1490158800.0 \n",
- "2 12:00:00 1493348400.0 77.0 263770000000 \n",
- "3 12:00:00 1501210800.0 20.24 252425000000 \n",
- "4 12:00:00 1509332400.0 42.3 264947000000 \n",
- "5 12:00:00 1517367600.0 69.36 267177000000 \n",
- "6 12:00:00 1521687600.0 \n",
- "7 12:00:00 1524798000.0 94.17 279736000000 \n",
- "8 12:00:00 1532919600.0 21.69 268065000000 \n",
- "9 12:00:00 1540782000.0 44.65 281657000000 \n",
- "10 12:00:00 1548730800.0 71.74 281059000000 \n",
- "11 12:00:00 1556247600.0 91.58 291450000000 \n",
- "12 12:00:00 1564455600.0 20.0 279960000000 \n",
- "13 08:30:00 1569367800.0 \n",
- "14 12:00:00 1572404400.0 40.29 292019000000 \n",
- "15 12:00:00 1580353200.0 62.22 292566000000 \n",
- "16 15:30:00 1584945000.0 \n",
- "17 12:00:00 1588215600.0 88.91 305375000000 \n",
- "18 12:00:00 1595991600.0 22.57 301073000000 \n",
- "19 12:00:00 1603854000.0 44.44 313463000000 \n",
- "20 12:00:00 1611802800.0 69.8 313755000000 \n",
- "21 12:00:00 1616382000.0 \n",
- "22 12:00:00 1619578800.0 96.0 328769000000 \n",
- "23 12:00:00 1627441200.0 23.02 308289000000 \n",
- "24 12:00:00 1635303600.0 46.23 311295000000 \n",
- "25 12:00:00 1643252400.0 71.71 311381000000 \n",
- "26 12:00:00 1647918000.0 \n",
- "27 12:00:00 1650942000.0 94.35 323852000000 \n",
- "28 12:00:00 1658890800.0 22.93 310098000000 \n",
- "29 12:00:00 1666839600.0 44.01 321568000000 \n",
- "\n",
- " EquityToAssetRatio ForecastDividendPerShare1stQuarter \\\n",
- "0 0.006 \n",
- "1 \n",
- "2 0.006 - \n",
- "3 0.007 \n",
- "4 0.006 \n",
- "5 0.007 \n",
- "6 \n",
- "7 0.007 - \n",
- "8 0.007 \n",
- "9 0.006 \n",
- "10 0.005 \n",
- "11 0.005 - \n",
- "12 0.005 \n",
- "13 \n",
- "14 0.004 \n",
- "15 0.005 \n",
- "16 \n",
- "17 0.004 - \n",
- "18 0.005 \n",
- "19 0.005 \n",
- "20 0.005 \n",
- "21 \n",
- "22 0.005 - \n",
- "23 0.005 \n",
- "24 0.005 \n",
- "25 0.005 \n",
- "26 \n",
- "27 0.004 - \n",
- "28 0.004 \n",
- "29 0.004 \n",
- "\n",
- " ForecastDividendPerShare2ndQuarter ForecastDividendPerShare3rdQuarter \\\n",
- "0 \n",
- "1 - - \n",
- "2 24.0 - \n",
- "3 24.0 - \n",
- "4 - \n",
- "5 \n",
- "6 - - \n",
- "7 27.0 - \n",
- "8 27.0 - \n",
- "9 - \n",
- "10 \n",
- "11 26.0 - \n",
- "12 26.0 - \n",
- "13 24.0 - \n",
- "14 - \n",
- "15 \n",
- "16 - - \n",
- "17 24.0 - \n",
- "18 24.0 - \n",
- "19 - \n",
- "20 \n",
- "21 - - \n",
- "22 26.0 - \n",
- "23 26.0 - \n",
- "24 - \n",
- "25 \n",
- "26 - - \n",
- "27 26.0 - \n",
- "28 26.0 - \n",
- "29 - \n",
- "\n",
- " ForecastDividendPerShareAnnual ForecastDividendPerShareFiscalYearEnd \\\n",
- "0 42.0 21.0 \n",
- "1 47.0 26.0 \n",
- "2 48.0 24.0 \n",
- "3 48.0 24.0 \n",
- "4 48.0 24.0 \n",
- "5 48.0 24.0 \n",
- "6 57.0 33.0 \n",
- "7 54.0 27.0 \n",
- "8 54.0 27.0 \n",
- "9 54.0 27.0 \n",
- "10 54.0 27.0 \n",
- "11 52.0 26.0 \n",
- "12 52.0 26.0 \n",
- "13 48.0 24.0 \n",
- "14 48.0 24.0 \n",
- "15 48.0 24.0 \n",
- "16 54.0 30.0 \n",
- "17 48.0 24.0 \n",
- "18 48.0 24.0 \n",
- "19 52.0 26.0 \n",
- "20 52.0 26.0 \n",
- "21 68.0 42.0 \n",
- "22 52.0 26.0 \n",
- "23 52.0 26.0 \n",
- "24 53.0 27.0 \n",
- "25 53.0 27.0 \n",
- "26 72.0 46.0 \n",
- "27 52.0 26.0 \n",
- "28 52.0 26.0 \n",
- "29 52.0 26.0 \n",
- "\n",
- " ForecastEarningsPerShare ForecastNetSales ForecastOperatingProfit \\\n",
- "0 70.32 106000000000 54000000000 \n",
- "1 76.39 107000000000 59000000000 \n",
- "2 78.64 112000000000 60000000000 \n",
- "3 79.27 112000000000 60000000000 \n",
- "4 79.27 110000000000 60000000000 \n",
- "5 79.27 110000000000 60000000000 \n",
- "6 93.26 120000000000 71000000000 \n",
- "7 89.59 123000000000 68000000000 \n",
- "8 89.59 123000000000 68000000000 \n",
- "9 89.61 120000000000 68000000000 \n",
- "10 89.61 120000000000 68000000000 \n",
- "11 85.88 122000000000 66000000000 \n",
- "12 85.91 122000000000 66000000000 \n",
- "13 78.44 117000000000 60000000000 \n",
- "14 78.44 117000000000 60000000000 \n",
- "15 78.44 117000000000 60000000000 \n",
- "16 88.71 123000000000 67500000000 \n",
- "17 79.37 121500000000 62000000000 \n",
- "18 79.4 121500000000 62000000000 \n",
- "19 85.0 126000000000 65500000000 \n",
- "20 85.0 126000000000 65500000000 \n",
- "21 96.21 133000000000 74000000000 \n",
- "22 85.0 130000000000 66000000000 \n",
- "23 85.55 130000000000 66000000000 \n",
- "24 86.88 131000000000 67500000000 \n",
- "25 86.88 131000000000 67500000000 \n",
- "26 94.43 135500000000 73500000000 \n",
- "27 85.3 132500000000 65500000000 \n",
- "28 85.42 132500000000 65500000000 \n",
- "29 85.42 132500000000 65500000000 \n",
- "\n",
- " ForecastOrdinaryProfit ForecastProfit LocalCode \\\n",
- "0 55500000000 38500000000 86970 \n",
- "1 60000000000 41800000000 86970 \n",
- "2 61500000000 42500000000 86970 \n",
- "3 61500000000 42500000000 86970 \n",
- "4 61500000000 42500000000 86970 \n",
- "5 61500000000 42500000000 86970 \n",
- "6 72500000000 50000000000 86970 \n",
- "7 69000000000 48000000000 86970 \n",
- "8 69000000000 48000000000 86970 \n",
- "9 69000000000 48000000000 86970 \n",
- "10 69000000000 48000000000 86970 \n",
- "11 66500000000 46000000000 86970 \n",
- "12 66500000000 46000000000 86970 \n",
- "13 60500000000 42000000000 86970 \n",
- "14 60500000000 42000000000 86970 \n",
- "15 60500000000 42000000000 86970 \n",
- "16 68000000000 47500000000 86970 \n",
- "17 62100000000 42500000000 86970 \n",
- "18 62100000000 42500000000 86970 \n",
- "19 65600000000 45500000000 86970 \n",
- "20 65600000000 45500000000 86970 \n",
- "21 74100000000 51500000000 86970 \n",
- "22 66000000000 45500000000 86970 \n",
- "23 66000000000 45500000000 86970 \n",
- "24 67500000000 46000000000 86970 \n",
- "25 67500000000 46000000000 86970 \n",
- "26 73500000000 50000000000 86970 \n",
- "27 65500000000 45000000000 86970 \n",
- "28 65500000000 45000000000 86970 \n",
- "29 65500000000 45000000000 86970 \n",
- "\n",
- " MaterialChangesInSubsidiaries NetSales \\\n",
- "0 false 80663000000 \n",
- "1 \n",
- "2 false 107885000000 \n",
- "3 false 27876000000 \n",
- "4 false 55762000000 \n",
- "5 false 87861000000 \n",
- "6 \n",
- "7 false 120711000000 \n",
- "8 false 29562000000 \n",
- "9 false 59231000000 \n",
- "10 false 92020000000 \n",
- "11 false 121134000000 \n",
- "12 false 29069000000 \n",
- "13 \n",
- "14 false 57936000000 \n",
- "15 true 87433000000 \n",
- "16 \n",
- "17 true 123688000000 \n",
- "18 false 32666000000 \n",
- "19 false 63834000000 \n",
- "20 false 97273000000 \n",
- "21 \n",
- "22 false 133343000000 \n",
- "23 false 32503000000 \n",
- "24 false 65506000000 \n",
- "25 false 100586000000 \n",
- "26 \n",
- "27 false 135432000000 \n",
- "28 false 33576000000 \n",
- "29 false 66486000000 \n",
- "\n",
- " NumberOfIssuedAndOutstandingSharesAtTheEndOfFiscalYearIncludingTreasuryStock \\\n",
- "0 549069100 \n",
- "1 \n",
- "2 549069100 \n",
- "3 549069100 \n",
- "4 549069100 \n",
- "5 549069100 \n",
- "6 \n",
- "7 536351448 \n",
- "8 536351448 \n",
- "9 536351448 \n",
- "10 536351448 \n",
- "11 536351448 \n",
- "12 536351448 \n",
- "13 \n",
- "14 536351448 \n",
- "15 536351448 \n",
- "16 \n",
- "17 536351448 \n",
- "18 536351448 \n",
- "19 536351448 \n",
- "20 536351448 \n",
- "21 \n",
- "22 536351448 \n",
- "23 536351448 \n",
- "24 536351448 \n",
- "25 536351448 \n",
- "26 \n",
- "27 528578441 \n",
- "28 528578441 \n",
- "29 528578441 \n",
- "\n",
- " NumberOfTreasuryStockAtTheEndOfFiscalYear OperatingProfit OrdinaryProfit \\\n",
- "0 2754052 44814000000 45783000000 \n",
- "1 \n",
- "2 8636052 59377000000 60604000000 \n",
- "3 13303873 16440000000 16630000000 \n",
- "4 13303807 32808000000 33554000000 \n",
- "5 13303754 53090000000 54042000000 \n",
- "6 \n",
- "7 585416 71791000000 72990000000 \n",
- "8 585416 17413000000 17609000000 \n",
- "9 721216 34355000000 35098000000 \n",
- "10 721216 54302000000 55285000000 \n",
- "11 718620 69535000000 70786000000 \n",
- "12 911324 16246000000 16402000000 \n",
- "13 \n",
- "14 911324 31870000000 32011000000 \n",
- "15 911324 48176000000 48586000000 \n",
- "16 \n",
- "17 904476 68533000000 69095000000 \n",
- "18 1075955 18365000000 18414000000 \n",
- "19 1069255 35191000000 35225000000 \n",
- "20 1069255 54365000000 54479000000 \n",
- "21 \n",
- "22 1034400 74565000000 74732000000 \n",
- "23 5170427 18459000000 18471000000 \n",
- "24 8822727 36051000000 36044000000 \n",
- "25 8822727 55967000000 55936000000 \n",
- "26 \n",
- "27 1037782 73473000000 73429000000 \n",
- "28 1938843 17777000000 17790000000 \n",
- "29 1861043 34127000000 34122000000 \n",
- "\n",
- " Profit ResultDividendPerShare1stQuarter \\\n",
- "0 31832000000 - \n",
- "1 \n",
- "2 42124000000 - \n",
- "3 10874000000 - \n",
- "4 22692000000 - \n",
- "5 37195000000 - \n",
- "6 \n",
- "7 50484000000 - \n",
- "8 11623000000 - \n",
- "9 23920000000 - \n",
- "10 38430000000 - \n",
- "11 49057000000 - \n",
- "12 10711000000 - \n",
- "13 \n",
- "14 21573000000 - \n",
- "15 33317000000 - \n",
- "16 \n",
- "17 47609000000 - \n",
- "18 12082000000 - \n",
- "19 23787000000 - \n",
- "20 37361000000 - \n",
- "21 \n",
- "22 51389000000 - \n",
- "23 12291000000 - \n",
- "24 24564000000 - \n",
- "25 38013000000 - \n",
- "26 \n",
- "27 49955000000 - \n",
- "28 12089000000 - \n",
- "29 23189000000 - \n",
- "\n",
- " ResultDividendPerShare2ndQuarter ResultDividendPerShare3rdQuarter \\\n",
- "0 21.0 - \n",
- "1 \n",
- "2 21.0 - \n",
- "3 \n",
- "4 24.0 \n",
- "5 24.0 - \n",
- "6 \n",
- "7 24.0 - \n",
- "8 \n",
- "9 27.0 \n",
- "10 27.0 - \n",
- "11 27.0 - \n",
- "12 \n",
- "13 \n",
- "14 24.0 \n",
- "15 24.0 - \n",
- "16 \n",
- "17 24.0 - \n",
- "18 \n",
- "19 26.0 \n",
- "20 26.0 - \n",
- "21 \n",
- "22 26.0 - \n",
- "23 \n",
- "24 26.0 \n",
- "25 26.0 - \n",
- "26 \n",
- "27 26.0 - \n",
- "28 \n",
- "29 26.0 \n",
- "\n",
- " ResultDividendPerShareAnnual ResultDividendPerShareFiscalYearEnd \\\n",
- "0 \n",
- "1 \n",
- "2 47.0 26.0 \n",
- "3 \n",
- "4 \n",
- "5 \n",
- "6 \n",
- "7 67.0 43.0 \n",
- "8 \n",
- "9 \n",
- "10 \n",
- "11 70.0 43.0 \n",
- "12 \n",
- "13 \n",
- "14 \n",
- "15 \n",
- "16 \n",
- "17 54.0 30.0 \n",
- "18 \n",
- "19 \n",
- "20 \n",
- "21 \n",
- "22 68.0 42.0 \n",
- "23 \n",
- "24 \n",
- "25 \n",
- "26 \n",
- "27 72.0 46.0 \n",
- "28 \n",
- "29 \n",
- "\n",
- " RetrospectiveRestatement TotalAssets TypeOfCurrentPeriod \\\n",
- "0 40450677000000 3Q \n",
- "1 FY \n",
- "2 41288932000000 FY \n",
- "3 37878487000000 1Q \n",
- "4 42523504000000 2Q \n",
- "5 37987261000000 3Q \n",
- "6 FY \n",
- "7 41316341000000 FY \n",
- "8 35842130000000 1Q \n",
- "9 42544750000000 2Q \n",
- "10 55009203000000 3Q \n",
- "11 54069405000000 FY \n",
- "12 56422396000000 1Q \n",
- "13 FY \n",
- "14 68410143000000 2Q \n",
- "15 56671198000000 3Q \n",
- "16 FY \n",
- "17 67286302000000 FY \n",
- "18 60827068000000 1Q \n",
- "19 60545559000000 2Q \n",
- "20 59393100000000 3Q \n",
- "21 FY \n",
- "22 60075678000000 FY \n",
- "23 61301218000000 1Q \n",
- "24 59583064000000 2Q \n",
- "25 62076519000000 3Q \n",
- "26 FY \n",
- "27 71463434000000 FY \n",
- "28 76048180000000 1Q \n",
- "29 78465370000000 2Q \n",
- "\n",
- " TypeOfDocument \n",
- "0 3QFinancialStatements_Consolidated_IFRS \n",
- "1 ForecastRevision \n",
- "2 FYFinancialStatements_Consolidated_IFRS \n",
- "3 1QFinancialStatements_Consolidated_IFRS \n",
- "4 2QFinancialStatements_Consolidated_IFRS \n",
- "5 3QFinancialStatements_Consolidated_IFRS \n",
- "6 ForecastRevision \n",
- "7 FYFinancialStatements_Consolidated_IFRS \n",
- "8 1QFinancialStatements_Consolidated_IFRS \n",
- "9 2QFinancialStatements_Consolidated_IFRS \n",
- "10 3QFinancialStatements_Consolidated_IFRS \n",
- "11 FYFinancialStatements_Consolidated_IFRS \n",
- "12 1QFinancialStatements_Consolidated_IFRS \n",
- "13 ForecastRevision \n",
- "14 2QFinancialStatements_Consolidated_IFRS \n",
- "15 3QFinancialStatements_Consolidated_IFRS \n",
- "16 ForecastRevision \n",
- "17 FYFinancialStatements_Consolidated_IFRS \n",
- "18 1QFinancialStatements_Consolidated_IFRS \n",
- "19 2QFinancialStatements_Consolidated_IFRS \n",
- "20 3QFinancialStatements_Consolidated_IFRS \n",
- "21 ForecastRevision \n",
- "22 FYFinancialStatements_Consolidated_IFRS \n",
- "23 1QFinancialStatements_Consolidated_IFRS \n",
- "24 2QFinancialStatements_Consolidated_IFRS \n",
- "25 3QFinancialStatements_Consolidated_IFRS \n",
- "26 ForecastRevision \n",
- "27 FYFinancialStatements_Consolidated_IFRS \n",
- "28 1QFinancialStatements_Consolidated_IFRS \n",
- "29 2QFinancialStatements_Consolidated_IFRS "
- ],
- "text/html": [
- "\n",
- " \n",
- "
\n",
- "
\n",
- "\n",
- "
\n",
- " \n",
- " \n",
- " \n",
- " DisclosureNumber \n",
- " DisclosedDate \n",
- " ApplyingOfSpecificAccountingOfTheQuarterlyFinancialStatements \n",
- " AverageNumberOfShares \n",
- " BookValuePerShare \n",
- " ChangesBasedOnRevisionsOfAccountingStandard \n",
- " ChangesInAccountingEstimates \n",
- " ChangesOtherThanOnesBasedOnRevisionsOfAccountingStandard \n",
- " CurrentFiscalYearEndDate \n",
- " CurrentFiscalYearStartDate \n",
- " CurrentPeriodEndDate \n",
- " DisclosedTime \n",
- " DisclosedUnixTime \n",
- " EarningsPerShare \n",
- " Equity \n",
- " EquityToAssetRatio \n",
- " ForecastDividendPerShare1stQuarter \n",
- " ForecastDividendPerShare2ndQuarter \n",
- " ForecastDividendPerShare3rdQuarter \n",
- " ForecastDividendPerShareAnnual \n",
- " ForecastDividendPerShareFiscalYearEnd \n",
- " ForecastEarningsPerShare \n",
- " ForecastNetSales \n",
- " ForecastOperatingProfit \n",
- " ForecastOrdinaryProfit \n",
- " ForecastProfit \n",
- " LocalCode \n",
- " MaterialChangesInSubsidiaries \n",
- " NetSales \n",
- " NumberOfIssuedAndOutstandingSharesAtTheEndOfFiscalYearIncludingTreasuryStock \n",
- " NumberOfTreasuryStockAtTheEndOfFiscalYear \n",
- " OperatingProfit \n",
- " OrdinaryProfit \n",
- " Profit \n",
- " ResultDividendPerShare1stQuarter \n",
- " ResultDividendPerShare2ndQuarter \n",
- " ResultDividendPerShare3rdQuarter \n",
- " ResultDividendPerShareAnnual \n",
- " ResultDividendPerShareFiscalYearEnd \n",
- " RetrospectiveRestatement \n",
- " TotalAssets \n",
- " TypeOfCurrentPeriod \n",
- " TypeOfDocument \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " 0 \n",
- " 20170127483465 \n",
- " 2017-01-30 \n",
- " \n",
- " 547924549 \n",
- " \n",
- " false \n",
- " false \n",
- " false \n",
- " 2017-03-31 \n",
- " 2016-04-01 \n",
- " 2016-12-31 \n",
- " 12:00:00 \n",
- " 1485745200.0 \n",
- " 58.1 \n",
- " 260297000000 \n",
- " 0.006 \n",
- " \n",
- " \n",
- " \n",
- " 42.0 \n",
- " 21.0 \n",
- " 70.32 \n",
- " 106000000000 \n",
- " 54000000000 \n",
- " 55500000000 \n",
- " 38500000000 \n",
- " 86970 \n",
- " false \n",
- " 80663000000 \n",
- " 549069100 \n",
- " 2754052 \n",
- " 44814000000 \n",
- " 45783000000 \n",
- " 31832000000 \n",
- " - \n",
- " 21.0 \n",
- " - \n",
- " \n",
- " \n",
- " \n",
- " 40450677000000 \n",
- " 3Q \n",
- " 3QFinancialStatements_Consolidated_IFRS \n",
- " \n",
- " \n",
- " 1 \n",
- " 20170321424149 \n",
- " 2017-03-22 \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " 2017-03-31 \n",
- " 2016-04-01 \n",
- " 2017-03-31 \n",
- " 14:00:00 \n",
- " 1490158800.0 \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " - \n",
- " - \n",
- " 47.0 \n",
- " 26.0 \n",
- " 76.39 \n",
- " 107000000000 \n",
- " 59000000000 \n",
- " 60000000000 \n",
- " 41800000000 \n",
- " 86970 \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " FY \n",
- " ForecastRevision \n",
- " \n",
- " \n",
- " 2 \n",
- " 20170427453686 \n",
- " 2017-04-28 \n",
- " \n",
- " 547051034 \n",
- " 205.5 \n",
- " false \n",
- " false \n",
- " false \n",
- " 2017-03-31 \n",
- " 2016-04-01 \n",
- " 2017-03-31 \n",
- " 12:00:00 \n",
- " 1493348400.0 \n",
- " 77.0 \n",
- " 263770000000 \n",
- " 0.006 \n",
- " - \n",
- " 24.0 \n",
- " - \n",
- " 48.0 \n",
- " 24.0 \n",
- " 78.64 \n",
- " 112000000000 \n",
- " 60000000000 \n",
- " 61500000000 \n",
- " 42500000000 \n",
- " 86970 \n",
- " false \n",
- " 107885000000 \n",
- " 549069100 \n",
- " 8636052 \n",
- " 59377000000 \n",
- " 60604000000 \n",
- " 42124000000 \n",
- " - \n",
- " 21.0 \n",
- " - \n",
- " 47.0 \n",
- " 26.0 \n",
- " \n",
- " 41288932000000 \n",
- " FY \n",
- " FYFinancialStatements_Consolidated_IFRS \n",
- " \n",
- " \n",
- " 3 \n",
- " 20170727441140 \n",
- " 2017-07-28 \n",
- " \n",
- " 537208664 \n",
- " \n",
- " false \n",
- " false \n",
- " false \n",
- " 2018-03-31 \n",
- " 2017-04-01 \n",
- " 2017-06-30 \n",
- " 12:00:00 \n",
- " 1501210800.0 \n",
- " 20.24 \n",
- " 252425000000 \n",
- " 0.007 \n",
- " \n",
- " 24.0 \n",
- " - \n",
- " 48.0 \n",
- " 24.0 \n",
- " 79.27 \n",
- " 112000000000 \n",
- " 60000000000 \n",
- " 61500000000 \n",
- " 42500000000 \n",
- " 86970 \n",
- " false \n",
- " 27876000000 \n",
- " 549069100 \n",
- " 13303873 \n",
- " 16440000000 \n",
- " 16630000000 \n",
- " 10874000000 \n",
- " - \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " 37878487000000 \n",
- " 1Q \n",
- " 1QFinancialStatements_Consolidated_IFRS \n",
- " \n",
- " \n",
- " 4 \n",
- " 20171027401390 \n",
- " 2017-10-30 \n",
- " \n",
- " 536483009 \n",
- " \n",
- " false \n",
- " false \n",
- " false \n",
- " 2018-03-31 \n",
- " 2017-04-01 \n",
- " 2017-09-30 \n",
- " 12:00:00 \n",
- " 1509332400.0 \n",
- " 42.3 \n",
- " 264947000000 \n",
- " 0.006 \n",
- " \n",
- " \n",
- " - \n",
- " 48.0 \n",
- " 24.0 \n",
- " 79.27 \n",
- " 110000000000 \n",
- " 60000000000 \n",
- " 61500000000 \n",
- " 42500000000 \n",
- " 86970 \n",
- " false \n",
- " 55762000000 \n",
- " 549069100 \n",
- " 13303807 \n",
- " 32808000000 \n",
- " 33554000000 \n",
- " 22692000000 \n",
- " - \n",
- " 24.0 \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " 42523504000000 \n",
- " 2Q \n",
- " 2QFinancialStatements_Consolidated_IFRS \n",
- " \n",
- " \n",
- " 5 \n",
- " 20180130459766 \n",
- " 2018-01-31 \n",
- " \n",
- " 536242907 \n",
- " \n",
- " false \n",
- " false \n",
- " false \n",
- " 2018-03-31 \n",
- " 2017-04-01 \n",
- " 2017-12-31 \n",
- " 12:00:00 \n",
- " 1517367600.0 \n",
- " 69.36 \n",
- " 267177000000 \n",
- " 0.007 \n",
- " \n",
- " \n",
- " \n",
- " 48.0 \n",
- " 24.0 \n",
- " 79.27 \n",
- " 110000000000 \n",
- " 60000000000 \n",
- " 61500000000 \n",
- " 42500000000 \n",
- " 86970 \n",
- " false \n",
- " 87861000000 \n",
- " 549069100 \n",
- " 13303754 \n",
- " 53090000000 \n",
- " 54042000000 \n",
- " 37195000000 \n",
- " - \n",
- " 24.0 \n",
- " - \n",
- " \n",
- " \n",
- " \n",
- " 37987261000000 \n",
- " 3Q \n",
- " 3QFinancialStatements_Consolidated_IFRS \n",
- " \n",
- " \n",
- " 6 \n",
- " 20180322494488 \n",
- " 2018-03-22 \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " 2018-03-31 \n",
- " 2017-04-01 \n",
- " 2018-03-31 \n",
- " 12:00:00 \n",
- " 1521687600.0 \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " - \n",
- " - \n",
- " 57.0 \n",
- " 33.0 \n",
- " 93.26 \n",
- " 120000000000 \n",
- " 71000000000 \n",
- " 72500000000 \n",
- " 50000000000 \n",
- " 86970 \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " FY \n",
- " ForecastRevision \n",
- " \n",
- " \n",
- " 7 \n",
- " 20180426422269 \n",
- " 2018-04-27 \n",
- " \n",
- " 536125158 \n",
- " 208.99 \n",
- " false \n",
- " false \n",
- " false \n",
- " 2018-03-31 \n",
- " 2017-04-01 \n",
- " 2018-03-31 \n",
- " 12:00:00 \n",
- " 1524798000.0 \n",
- " 94.17 \n",
- " 279736000000 \n",
- " 0.007 \n",
- " - \n",
- " 27.0 \n",
- " - \n",
- " 54.0 \n",
- " 27.0 \n",
- " 89.59 \n",
- " 123000000000 \n",
- " 68000000000 \n",
- " 69000000000 \n",
- " 48000000000 \n",
- " 86970 \n",
- " false \n",
- " 120711000000 \n",
- " 536351448 \n",
- " 585416 \n",
- " 71791000000 \n",
- " 72990000000 \n",
- " 50484000000 \n",
- " - \n",
- " 24.0 \n",
- " - \n",
- " 67.0 \n",
- " 43.0 \n",
- " \n",
- " 41316341000000 \n",
- " FY \n",
- " FYFinancialStatements_Consolidated_IFRS \n",
- " \n",
- " \n",
- " 8 \n",
- " 20180727486943 \n",
- " 2018-07-30 \n",
- " \n",
- " 535766032 \n",
- " \n",
- " true \n",
- " false \n",
- " false \n",
- " 2019-03-31 \n",
- " 2018-04-01 \n",
- " 2018-06-30 \n",
- " 12:00:00 \n",
- " 1532919600.0 \n",
- " 21.69 \n",
- " 268065000000 \n",
- " 0.007 \n",
- " \n",
- " 27.0 \n",
- " - \n",
- " 54.0 \n",
- " 27.0 \n",
- " 89.59 \n",
- " 123000000000 \n",
- " 68000000000 \n",
- " 69000000000 \n",
- " 48000000000 \n",
- " 86970 \n",
- " false \n",
- " 29562000000 \n",
- " 536351448 \n",
- " 585416 \n",
- " 17413000000 \n",
- " 17609000000 \n",
- " 11623000000 \n",
- " - \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " 35842130000000 \n",
- " 1Q \n",
- " 1QFinancialStatements_Consolidated_IFRS \n",
- " \n",
- " \n",
- " 9 \n",
- " 20181026423739 \n",
- " 2018-10-29 \n",
- " \n",
- " 535725501 \n",
- " \n",
- " true \n",
- " false \n",
- " false \n",
- " 2019-03-31 \n",
- " 2018-04-01 \n",
- " 2018-09-30 \n",
- " 12:00:00 \n",
- " 1540782000.0 \n",
- " 44.65 \n",
- " 281657000000 \n",
- " 0.006 \n",
- " \n",
- " \n",
- " - \n",
- " 54.0 \n",
- " 27.0 \n",
- " 89.61 \n",
- " 120000000000 \n",
- " 68000000000 \n",
- " 69000000000 \n",
- " 48000000000 \n",
- " 86970 \n",
- " false \n",
- " 59231000000 \n",
- " 536351448 \n",
- " 721216 \n",
- " 34355000000 \n",
- " 35098000000 \n",
- " 23920000000 \n",
- " - \n",
- " 27.0 \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " 42544750000000 \n",
- " 2Q \n",
- " 2QFinancialStatements_Consolidated_IFRS \n",
- " \n",
- " \n",
- " 10 \n",
- " 20190128464636 \n",
- " 2019-01-29 \n",
- " \n",
- " 535693629 \n",
- " \n",
- " true \n",
- " false \n",
- " false \n",
- " 2019-03-31 \n",
- " 2018-04-01 \n",
- " 2018-12-31 \n",
- " 12:00:00 \n",
- " 1548730800.0 \n",
- " 71.74 \n",
- " 281059000000 \n",
- " 0.005 \n",
- " \n",
- " \n",
- " \n",
- " 54.0 \n",
- " 27.0 \n",
- " 89.61 \n",
- " 120000000000 \n",
- " 68000000000 \n",
- " 69000000000 \n",
- " 48000000000 \n",
- " 86970 \n",
- " false \n",
- " 92020000000 \n",
- " 536351448 \n",
- " 721216 \n",
- " 54302000000 \n",
- " 55285000000 \n",
- " 38430000000 \n",
- " - \n",
- " 27.0 \n",
- " - \n",
- " \n",
- " \n",
- " \n",
- " 55009203000000 \n",
- " 3Q \n",
- " 3QFinancialStatements_Consolidated_IFRS \n",
- " \n",
- " \n",
- " 11 \n",
- " 20190425411956 \n",
- " 2019-04-26 \n",
- " \n",
- " 535678846 \n",
- " 220.37 \n",
- " true \n",
- " false \n",
- " false \n",
- " 2019-03-31 \n",
- " 2018-04-01 \n",
- " 2019-03-31 \n",
- " 12:00:00 \n",
- " 1556247600.0 \n",
- " 91.58 \n",
- " 291450000000 \n",
- " 0.005 \n",
- " - \n",
- " 26.0 \n",
- " - \n",
- " 52.0 \n",
- " 26.0 \n",
- " 85.88 \n",
- " 122000000000 \n",
- " 66000000000 \n",
- " 66500000000 \n",
- " 46000000000 \n",
- " 86970 \n",
- " false \n",
- " 121134000000 \n",
- " 536351448 \n",
- " 718620 \n",
- " 69535000000 \n",
- " 70786000000 \n",
- " 49057000000 \n",
- " - \n",
- " 27.0 \n",
- " - \n",
- " 70.0 \n",
- " 43.0 \n",
- " \n",
- " 54069405000000 \n",
- " FY \n",
- " FYFinancialStatements_Consolidated_IFRS \n",
- " \n",
- " \n",
- " 12 \n",
- " 20190726476880 \n",
- " 2019-07-30 \n",
- " \n",
- " 535522061 \n",
- " \n",
- " true \n",
- " false \n",
- " false \n",
- " 2020-03-31 \n",
- " 2019-04-01 \n",
- " 2019-06-30 \n",
- " 12:00:00 \n",
- " 1564455600.0 \n",
- " 20.0 \n",
- " 279960000000 \n",
- " 0.005 \n",
- " \n",
- " 26.0 \n",
- " - \n",
- " 52.0 \n",
- " 26.0 \n",
- " 85.91 \n",
- " 122000000000 \n",
- " 66000000000 \n",
- " 66500000000 \n",
- " 46000000000 \n",
- " 86970 \n",
- " false \n",
- " 29069000000 \n",
- " 536351448 \n",
- " 911324 \n",
- " 16246000000 \n",
- " 16402000000 \n",
- " 10711000000 \n",
- " - \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " 56422396000000 \n",
- " 1Q \n",
- " 1QFinancialStatements_Consolidated_IFRS \n",
- " \n",
- " \n",
- " 13 \n",
- " 20190920499881 \n",
- " 2019-09-25 \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " 2020-03-31 \n",
- " 2019-04-01 \n",
- " 2020-03-31 \n",
- " 08:30:00 \n",
- " 1569367800.0 \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " 24.0 \n",
- " - \n",
- " 48.0 \n",
- " 24.0 \n",
- " 78.44 \n",
- " 117000000000 \n",
- " 60000000000 \n",
- " 60500000000 \n",
- " 42000000000 \n",
- " 86970 \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " FY \n",
- " ForecastRevision \n",
- " \n",
- " \n",
- " 14 \n",
- " 20191029414616 \n",
- " 2019-10-30 \n",
- " \n",
- " 535480869 \n",
- " \n",
- " true \n",
- " true \n",
- " false \n",
- " 2020-03-31 \n",
- " 2019-04-01 \n",
- " 2019-09-30 \n",
- " 12:00:00 \n",
- " 1572404400.0 \n",
- " 40.29 \n",
- " 292019000000 \n",
- " 0.004 \n",
- " \n",
- " \n",
- " - \n",
- " 48.0 \n",
- " 24.0 \n",
- " 78.44 \n",
- " 117000000000 \n",
- " 60000000000 \n",
- " 60500000000 \n",
- " 42000000000 \n",
- " 86970 \n",
- " false \n",
- " 57936000000 \n",
- " 536351448 \n",
- " 911324 \n",
- " 31870000000 \n",
- " 32011000000 \n",
- " 21573000000 \n",
- " - \n",
- " 24.0 \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " 68410143000000 \n",
- " 2Q \n",
- " 2QFinancialStatements_Consolidated_IFRS \n",
- " \n",
- " \n",
- " 15 \n",
- " 20200129453073 \n",
- " 2020-01-30 \n",
- " \n",
- " 535467238 \n",
- " \n",
- " true \n",
- " true \n",
- " false \n",
- " 2020-03-31 \n",
- " 2019-04-01 \n",
- " 2019-12-31 \n",
- " 12:00:00 \n",
- " 1580353200.0 \n",
- " 62.22 \n",
- " 292566000000 \n",
- " 0.005 \n",
- " \n",
- " \n",
- " \n",
- " 48.0 \n",
- " 24.0 \n",
- " 78.44 \n",
- " 117000000000 \n",
- " 60000000000 \n",
- " 60500000000 \n",
- " 42000000000 \n",
- " 86970 \n",
- " true \n",
- " 87433000000 \n",
- " 536351448 \n",
- " 911324 \n",
- " 48176000000 \n",
- " 48586000000 \n",
- " 33317000000 \n",
- " - \n",
- " 24.0 \n",
- " - \n",
- " \n",
- " \n",
- " \n",
- " 56671198000000 \n",
- " 3Q \n",
- " 3QFinancialStatements_Consolidated_IFRS \n",
- " \n",
- " \n",
- " 16 \n",
- " 20200319481930 \n",
- " 2020-03-23 \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " 2020-03-31 \n",
- " 2019-04-01 \n",
- " 2020-03-31 \n",
- " 15:30:00 \n",
- " 1584945000.0 \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " - \n",
- " - \n",
- " 54.0 \n",
- " 30.0 \n",
- " 88.71 \n",
- " 123000000000 \n",
- " 67500000000 \n",
- " 68000000000 \n",
- " 47500000000 \n",
- " 86970 \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " FY \n",
- " ForecastRevision \n",
- " \n",
- " \n",
- " 17 \n",
- " 20200429402226 \n",
- " 2020-04-30 \n",
- " \n",
- " 535464274 \n",
- " 231.75 \n",
- " true \n",
- " true \n",
- " false \n",
- " 2020-03-31 \n",
- " 2019-04-01 \n",
- " 2020-03-31 \n",
- " 12:00:00 \n",
- " 1588215600.0 \n",
- " 88.91 \n",
- " 305375000000 \n",
- " 0.004 \n",
- " - \n",
- " 24.0 \n",
- " - \n",
- " 48.0 \n",
- " 24.0 \n",
- " 79.37 \n",
- " 121500000000 \n",
- " 62000000000 \n",
- " 62100000000 \n",
- " 42500000000 \n",
- " 86970 \n",
- " true \n",
- " 123688000000 \n",
- " 536351448 \n",
- " 904476 \n",
- " 68533000000 \n",
- " 69095000000 \n",
- " 47609000000 \n",
- " - \n",
- " 24.0 \n",
- " - \n",
- " 54.0 \n",
- " 30.0 \n",
- " \n",
- " 67286302000000 \n",
- " FY \n",
- " FYFinancialStatements_Consolidated_IFRS \n",
- " \n",
- " \n",
- " 18 \n",
- " 20200728468352 \n",
- " 2020-07-29 \n",
- " \n",
- " 535342754 \n",
- " \n",
- " false \n",
- " false \n",
- " false \n",
- " 2021-03-31 \n",
- " 2020-04-01 \n",
- " 2020-06-30 \n",
- " 12:00:00 \n",
- " 1595991600.0 \n",
- " 22.57 \n",
- " 301073000000 \n",
- " 0.005 \n",
- " \n",
- " 24.0 \n",
- " - \n",
- " 48.0 \n",
- " 24.0 \n",
- " 79.4 \n",
- " 121500000000 \n",
- " 62000000000 \n",
- " 62100000000 \n",
- " 42500000000 \n",
- " 86970 \n",
- " false \n",
- " 32666000000 \n",
- " 536351448 \n",
- " 1075955 \n",
- " 18365000000 \n",
- " 18414000000 \n",
- " 12082000000 \n",
- " - \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " 60827068000000 \n",
- " 1Q \n",
- " 1QFinancialStatements_Consolidated_IFRS \n",
- " \n",
- " \n",
- " 19 \n",
- " 20201027409944 \n",
- " 2020-10-28 \n",
- " \n",
- " 535311832 \n",
- " \n",
- " false \n",
- " false \n",
- " false \n",
- " 2021-03-31 \n",
- " 2020-04-01 \n",
- " 2020-09-30 \n",
- " 12:00:00 \n",
- " 1603854000.0 \n",
- " 44.44 \n",
- " 313463000000 \n",
- " 0.005 \n",
- " \n",
- " \n",
- " - \n",
- " 52.0 \n",
- " 26.0 \n",
- " 85.0 \n",
- " 126000000000 \n",
- " 65500000000 \n",
- " 65600000000 \n",
- " 45500000000 \n",
- " 86970 \n",
- " false \n",
- " 63834000000 \n",
- " 536351448 \n",
- " 1069255 \n",
- " 35191000000 \n",
- " 35225000000 \n",
- " 23787000000 \n",
- " - \n",
- " 26.0 \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " 60545559000000 \n",
- " 2Q \n",
- " 2QFinancialStatements_Consolidated_IFRS \n",
- " \n",
- " \n",
- " 20 \n",
- " 20210127450161 \n",
- " 2021-01-28 \n",
- " \n",
- " 535301916 \n",
- " \n",
- " false \n",
- " false \n",
- " false \n",
- " 2021-03-31 \n",
- " 2020-04-01 \n",
- " 2020-12-31 \n",
- " 12:00:00 \n",
- " 1611802800.0 \n",
- " 69.8 \n",
- " 313755000000 \n",
- " 0.005 \n",
- " \n",
- " \n",
- " \n",
- " 52.0 \n",
- " 26.0 \n",
- " 85.0 \n",
- " 126000000000 \n",
- " 65500000000 \n",
- " 65600000000 \n",
- " 45500000000 \n",
- " 86970 \n",
- " false \n",
- " 97273000000 \n",
- " 536351448 \n",
- " 1069255 \n",
- " 54365000000 \n",
- " 54479000000 \n",
- " 37361000000 \n",
- " - \n",
- " 26.0 \n",
- " - \n",
- " \n",
- " \n",
- " \n",
- " 59393100000000 \n",
- " 3Q \n",
- " 3QFinancialStatements_Consolidated_IFRS \n",
- " \n",
- " \n",
- " 21 \n",
- " 20210319481454 \n",
- " 2021-03-22 \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " 2021-03-31 \n",
- " 2020-04-01 \n",
- " 2021-03-31 \n",
- " 12:00:00 \n",
- " 1616382000.0 \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " - \n",
- " - \n",
- " 68.0 \n",
- " 42.0 \n",
- " 96.21 \n",
- " 133000000000 \n",
- " 74000000000 \n",
- " 74100000000 \n",
- " 51500000000 \n",
- " 86970 \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " FY \n",
- " ForecastRevision \n",
- " \n",
- " \n",
- " 22 \n",
- " 20210427402053 \n",
- " 2021-04-28 \n",
- " \n",
- " 535304490 \n",
- " 252.81 \n",
- " false \n",
- " false \n",
- " false \n",
- " 2021-03-31 \n",
- " 2020-04-01 \n",
- " 2021-03-31 \n",
- " 12:00:00 \n",
- " 1619578800.0 \n",
- " 96.0 \n",
- " 328769000000 \n",
- " 0.005 \n",
- " - \n",
- " 26.0 \n",
- " - \n",
- " 52.0 \n",
- " 26.0 \n",
- " 85.0 \n",
- " 130000000000 \n",
- " 66000000000 \n",
- " 66000000000 \n",
- " 45500000000 \n",
- " 86970 \n",
- " false \n",
- " 133343000000 \n",
- " 536351448 \n",
- " 1034400 \n",
- " 74565000000 \n",
- " 74732000000 \n",
- " 51389000000 \n",
- " - \n",
- " 26.0 \n",
- " - \n",
- " 68.0 \n",
- " 42.0 \n",
- " \n",
- " 60075678000000 \n",
- " FY \n",
- " FYFinancialStatements_Consolidated_IFRS \n",
- " \n",
- " \n",
- " 23 \n",
- " 20210727472046 \n",
- " 2021-07-28 \n",
- " \n",
- " 533875558 \n",
- " \n",
- " false \n",
- " false \n",
- " false \n",
- " 2022-03-31 \n",
- " 2021-04-01 \n",
- " 2021-06-30 \n",
- " 12:00:00 \n",
- " 1627441200.0 \n",
- " 23.02 \n",
- " 308289000000 \n",
- " 0.005 \n",
- " \n",
- " 26.0 \n",
- " - \n",
- " 52.0 \n",
- " 26.0 \n",
- " 85.55 \n",
- " 130000000000 \n",
- " 66000000000 \n",
- " 66000000000 \n",
- " 45500000000 \n",
- " 86970 \n",
- " false \n",
- " 32503000000 \n",
- " 536351448 \n",
- " 5170427 \n",
- " 18459000000 \n",
- " 18471000000 \n",
- " 12291000000 \n",
- " - \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " 61301218000000 \n",
- " 1Q \n",
- " 1QFinancialStatements_Consolidated_IFRS \n",
- " \n",
- " \n",
- " 24 \n",
- " 20211026416885 \n",
- " 2021-10-27 \n",
- " \n",
- " 531421385 \n",
- " \n",
- " false \n",
- " false \n",
- " false \n",
- " 2022-03-31 \n",
- " 2021-04-01 \n",
- " 2021-09-30 \n",
- " 12:00:00 \n",
- " 1635303600.0 \n",
- " 46.23 \n",
- " 311295000000 \n",
- " 0.005 \n",
- " \n",
- " \n",
- " - \n",
- " 53.0 \n",
- " 27.0 \n",
- " 86.88 \n",
- " 131000000000 \n",
- " 67500000000 \n",
- " 67500000000 \n",
- " 46000000000 \n",
- " 86970 \n",
- " false \n",
- " 65506000000 \n",
- " 536351448 \n",
- " 8822727 \n",
- " 36051000000 \n",
- " 36044000000 \n",
- " 24564000000 \n",
- " - \n",
- " 26.0 \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " 59583064000000 \n",
- " 2Q \n",
- " 2QFinancialStatements_Consolidated_IFRS \n",
- " \n",
- " \n",
- " 25 \n",
- " 20220126573026 \n",
- " 2022-01-27 \n",
- " \n",
- " 530119112 \n",
- " \n",
- " false \n",
- " false \n",
- " false \n",
- " 2022-03-31 \n",
- " 2021-04-01 \n",
- " 2021-12-31 \n",
- " 12:00:00 \n",
- " 1643252400.0 \n",
- " 71.71 \n",
- " 311381000000 \n",
- " 0.005 \n",
- " \n",
- " \n",
- " \n",
- " 53.0 \n",
- " 27.0 \n",
- " 86.88 \n",
- " 131000000000 \n",
- " 67500000000 \n",
- " 67500000000 \n",
- " 46000000000 \n",
- " 86970 \n",
- " false \n",
- " 100586000000 \n",
- " 536351448 \n",
- " 8822727 \n",
- " 55967000000 \n",
- " 55936000000 \n",
- " 38013000000 \n",
- " - \n",
- " 26.0 \n",
- " - \n",
- " \n",
- " \n",
- " \n",
- " 62076519000000 \n",
- " 3Q \n",
- " 3QFinancialStatements_Consolidated_IFRS \n",
- " \n",
- " \n",
- " 26 \n",
- " 20220318508090 \n",
- " 2022-03-22 \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " 2022-03-31 \n",
- " 2021-04-01 \n",
- " 2022-03-31 \n",
- " 12:00:00 \n",
- " 1647918000.0 \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " - \n",
- " - \n",
- " 72.0 \n",
- " 46.0 \n",
- " 94.43 \n",
- " 135500000000 \n",
- " 73500000000 \n",
- " 73500000000 \n",
- " 50000000000 \n",
- " 86970 \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " FY \n",
- " ForecastRevision \n",
- " \n",
- " \n",
- " 27 \n",
- " 20220425527054 \n",
- " 2022-04-26 \n",
- " \n",
- " 529487172 \n",
- " 230.88 \n",
- " false \n",
- " false \n",
- " false \n",
- " 2022-03-31 \n",
- " 2021-04-01 \n",
- " 2022-03-31 \n",
- " 12:00:00 \n",
- " 1650942000.0 \n",
- " 94.35 \n",
- " 323852000000 \n",
- " 0.004 \n",
- " - \n",
- " 26.0 \n",
- " - \n",
- " 52.0 \n",
- " 26.0 \n",
- " 85.3 \n",
- " 132500000000 \n",
- " 65500000000 \n",
- " 65500000000 \n",
- " 45000000000 \n",
- " 86970 \n",
- " false \n",
- " 135432000000 \n",
- " 528578441 \n",
- " 1037782 \n",
- " 73473000000 \n",
- " 73429000000 \n",
- " 49955000000 \n",
- " - \n",
- " 26.0 \n",
- " - \n",
- " 72.0 \n",
- " 46.0 \n",
- " \n",
- " 71463434000000 \n",
- " FY \n",
- " FYFinancialStatements_Consolidated_IFRS \n",
- " \n",
- " \n",
- " 28 \n",
- " 20220726504583 \n",
- " 2022-07-27 \n",
- " \n",
- " 527204054 \n",
- " \n",
- " false \n",
- " false \n",
- " false \n",
- " 2023-03-31 \n",
- " 2022-04-01 \n",
- " 2022-06-30 \n",
- " 12:00:00 \n",
- " 1658890800.0 \n",
- " 22.93 \n",
- " 310098000000 \n",
- " 0.004 \n",
- " \n",
- " 26.0 \n",
- " - \n",
- " 52.0 \n",
- " 26.0 \n",
- " 85.42 \n",
- " 132500000000 \n",
- " 65500000000 \n",
- " 65500000000 \n",
- " 45000000000 \n",
- " 86970 \n",
- " false \n",
- " 33576000000 \n",
- " 528578441 \n",
- " 1938843 \n",
- " 17777000000 \n",
- " 17790000000 \n",
- " 12089000000 \n",
- " - \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " 76048180000000 \n",
- " 1Q \n",
- " 1QFinancialStatements_Consolidated_IFRS \n",
- " \n",
- " \n",
- " 29 \n",
- " 20221026549969 \n",
- " 2022-10-27 \n",
- " \n",
- " 526953869 \n",
- " \n",
- " false \n",
- " true \n",
- " false \n",
- " 2023-03-31 \n",
- " 2022-04-01 \n",
- " 2022-09-30 \n",
- " 12:00:00 \n",
- " 1666839600.0 \n",
- " 44.01 \n",
- " 321568000000 \n",
- " 0.004 \n",
- " \n",
- " \n",
- " - \n",
- " 52.0 \n",
- " 26.0 \n",
- " 85.42 \n",
- " 132500000000 \n",
- " 65500000000 \n",
- " 65500000000 \n",
- " 45000000000 \n",
- " 86970 \n",
- " false \n",
- " 66486000000 \n",
- " 528578441 \n",
- " 1861043 \n",
- " 34127000000 \n",
- " 34122000000 \n",
- " 23189000000 \n",
- " - \n",
- " 26.0 \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " 78465370000000 \n",
- " 2Q \n",
- " 2QFinancialStatements_Consolidated_IFRS \n",
- " \n",
- " \n",
- "
\n",
- "
\n",
- "
\n",
- " \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " \n",
- "\n",
- " \n",
- "
\n",
- "
\n",
- " "
- ]
- },
- "metadata": {},
- "execution_count": 24
- }
- ]
+ "execution_count": null,
+ "outputs": []
},
{
"cell_type": "code",
@@ -7034,176 +734,10 @@
"df_fins[df_fins.isnull().any(axis=1)]\n"
],
"metadata": {
- "colab": {
- "base_uri": "https://localhost:8080/",
- "height": 0
- },
- "id": "h_8PnfBU_Kxh",
- "outputId": "3aee7679-2807-4d56-bc50-942a1eeb3308"
+ "id": "h_8PnfBU_Kxh"
},
- "execution_count": 25,
- "outputs": [
- {
- "output_type": "execute_result",
- "data": {
- "text/plain": [
- "Empty DataFrame\n",
- "Columns: [DisclosureNumber, DisclosedDate, ApplyingOfSpecificAccountingOfTheQuarterlyFinancialStatements, AverageNumberOfShares, BookValuePerShare, ChangesBasedOnRevisionsOfAccountingStandard, ChangesInAccountingEstimates, ChangesOtherThanOnesBasedOnRevisionsOfAccountingStandard, CurrentFiscalYearEndDate, CurrentFiscalYearStartDate, CurrentPeriodEndDate, DisclosedTime, DisclosedUnixTime, EarningsPerShare, Equity, EquityToAssetRatio, ForecastDividendPerShare1stQuarter, ForecastDividendPerShare2ndQuarter, ForecastDividendPerShare3rdQuarter, ForecastDividendPerShareAnnual, ForecastDividendPerShareFiscalYearEnd, ForecastEarningsPerShare, ForecastNetSales, ForecastOperatingProfit, ForecastOrdinaryProfit, ForecastProfit, LocalCode, MaterialChangesInSubsidiaries, NetSales, NumberOfIssuedAndOutstandingSharesAtTheEndOfFiscalYearIncludingTreasuryStock, NumberOfTreasuryStockAtTheEndOfFiscalYear, OperatingProfit, OrdinaryProfit, Profit, ResultDividendPerShare1stQuarter, ResultDividendPerShare2ndQuarter, ResultDividendPerShare3rdQuarter, ResultDividendPerShareAnnual, ResultDividendPerShareFiscalYearEnd, RetrospectiveRestatement, TotalAssets, TypeOfCurrentPeriod, TypeOfDocument]\n",
- "Index: []"
- ],
- "text/html": [
- "\n",
- " \n",
- "
\n",
- "
\n",
- "\n",
- "
\n",
- " \n",
- " \n",
- " \n",
- " DisclosureNumber \n",
- " DisclosedDate \n",
- " ApplyingOfSpecificAccountingOfTheQuarterlyFinancialStatements \n",
- " AverageNumberOfShares \n",
- " BookValuePerShare \n",
- " ChangesBasedOnRevisionsOfAccountingStandard \n",
- " ChangesInAccountingEstimates \n",
- " ChangesOtherThanOnesBasedOnRevisionsOfAccountingStandard \n",
- " CurrentFiscalYearEndDate \n",
- " CurrentFiscalYearStartDate \n",
- " CurrentPeriodEndDate \n",
- " DisclosedTime \n",
- " DisclosedUnixTime \n",
- " EarningsPerShare \n",
- " Equity \n",
- " EquityToAssetRatio \n",
- " ForecastDividendPerShare1stQuarter \n",
- " ForecastDividendPerShare2ndQuarter \n",
- " ForecastDividendPerShare3rdQuarter \n",
- " ForecastDividendPerShareAnnual \n",
- " ForecastDividendPerShareFiscalYearEnd \n",
- " ForecastEarningsPerShare \n",
- " ForecastNetSales \n",
- " ForecastOperatingProfit \n",
- " ForecastOrdinaryProfit \n",
- " ForecastProfit \n",
- " LocalCode \n",
- " MaterialChangesInSubsidiaries \n",
- " NetSales \n",
- " NumberOfIssuedAndOutstandingSharesAtTheEndOfFiscalYearIncludingTreasuryStock \n",
- " NumberOfTreasuryStockAtTheEndOfFiscalYear \n",
- " OperatingProfit \n",
- " OrdinaryProfit \n",
- " Profit \n",
- " ResultDividendPerShare1stQuarter \n",
- " ResultDividendPerShare2ndQuarter \n",
- " ResultDividendPerShare3rdQuarter \n",
- " ResultDividendPerShareAnnual \n",
- " ResultDividendPerShareFiscalYearEnd \n",
- " RetrospectiveRestatement \n",
- " TotalAssets \n",
- " TypeOfCurrentPeriod \n",
- " TypeOfDocument \n",
- " \n",
- " \n",
- " \n",
- " \n",
- "
\n",
- "
\n",
- "
\n",
- " \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " \n",
- "\n",
- " \n",
- "
\n",
- "
\n",
- " "
- ]
- },
- "metadata": {},
- "execution_count": 25
- }
- ]
+ "execution_count": null,
+ "outputs": []
},
{
"cell_type": "markdown",
@@ -7215,33 +749,6 @@
"id": "V6JdDezubeHw"
}
},
- {
- "cell_type": "markdown",
- "source": [
- "### ひとくちメモ集"
- ],
- "metadata": {
- "id": "Bl82YoLHbZFl"
- }
- },
- {
- "cell_type": "markdown",
- "source": [
- "- 決算短信の\"空文字\"と\"0\"と\"ー(バー)\"について\n",
- "\n",
- "決算短信の各項目のうち、0とある場合には数値が存在する項目であるが、百万円単位としたときに四捨五入等で切り捨てられた場合が該当します。 \n",
- "(例)売上高0のとき(売上高0.2百万円)\n",
- "\n",
- "一方、ー(バー)となる場合は、数値が存在しない項目という場合が該当します。 \n",
- "(例)売上高ーのとき(売上高0円)\n",
- "\n",
- "これらについてはよくまとめられた記事が[こちら](https://kabushikisoumu.com/less-than-unit)にありました!\n",
- "もしよろしければ、ご参考ください。"
- ],
- "metadata": {
- "id": "cjI-UdCIbqhw"
- }
- },
{
"cell_type": "markdown",
"source": [
@@ -7254,13 +761,15 @@
{
"cell_type": "code",
"source": [
- "# 2022年4月1日〜2022年6月30日の財務情報を取得\n",
- "df_fins = cli.get_statements_range(start_dt=\"20220401\", end_dt=\"20220630\")\n"
+ "# 過去の一定期間の財務情報を取得\n",
+ "d_from = datetime.now() - timedelta(days=300)\n",
+ "d_to = datetime.now() - timedelta(days=270)\n",
+ "df_fins = cli.get_statements_range(start_dt=d_from.strftime(format=\"%Y%m%d\"), end_dt=d_to.strftime(format=\"%Y%m%d\"))\n"
],
"metadata": {
"id": "EatgPstsnob-"
},
- "execution_count": 26,
+ "execution_count": null,
"outputs": []
},
{
@@ -7270,49 +779,15 @@
"df_fins[\"TypeOfDocument\"].value_counts()\n"
],
"metadata": {
- "colab": {
- "base_uri": "https://localhost:8080/"
- },
- "id": "CxONVOPLDM7l",
- "outputId": "277b7185-e053-4f66-c49d-be467cb3cbd2"
+ "id": "CxONVOPLDM7l"
},
- "execution_count": 27,
- "outputs": [
- {
- "output_type": "execute_result",
- "data": {
- "text/plain": [
- "FYFinancialStatements_Consolidated_JP 2162\n",
- "ForecastRevision 795\n",
- "1QFinancialStatements_Consolidated_JP 487\n",
- "FYFinancialStatements_NonConsolidated_JP 293\n",
- "2QFinancialStatements_Consolidated_JP 239\n",
- "NumericalCorrection 214\n",
- "3QFinancialStatements_Consolidated_JP 200\n",
- "FYFinancialStatements_Consolidated_IFRS 168\n",
- "1QFinancialStatements_NonConsolidated_JP 99\n",
- "2QFinancialStatements_NonConsolidated_JP 69\n",
- "3QFinancialStatements_NonConsolidated_JP 67\n",
- "1QFinancialStatements_Consolidated_IFRS 56\n",
- "FYFinancialStatements_REIT 29\n",
- "2QFinancialStatements_Consolidated_IFRS 14\n",
- "FYFinancialStatements_Consolidated_US 9\n",
- "3QFinancialStatements_Consolidated_IFRS 8\n",
- "ForecastRevision_REIT 4\n",
- "FYFinancialStatements_NonConsolidated_IFRS 2\n",
- "1QFinancialStatements_Consolidated_US 2\n",
- "Name: TypeOfDocument, dtype: int64"
- ]
- },
- "metadata": {},
- "execution_count": 27
- }
- ]
+ "execution_count": null,
+ "outputs": []
},
{
"cell_type": "markdown",
"source": [
- "書類種別には、連結(Consolidated)や非連結(NonConsolidated)決算、予想の修正(ForecastRevision)・数値の訂正(NumericalCorrection)の開示等があることがわかる。"
+ "書類種別には、連結(Consolidated)や非連結(NonConsolidated)決算、予想の修正(ForecastRevision)の開示等があることがわかる。"
],
"metadata": {
"id": "Bi86Iwo5FNr0"
@@ -7325,38 +800,10 @@
"df_fins[\"TypeOfCurrentPeriod\"].value_counts()\n"
],
"metadata": {
- "colab": {
- "base_uri": "https://localhost:8080/"
- },
- "id": "AWBl4QmfNw-G",
- "outputId": "5a0909b3-2233-4a88-dd6f-8573c67cbbff"
+ "id": "AWBl4QmfNw-G"
},
- "execution_count": 28,
- "outputs": [
- {
- "output_type": "execute_result",
- "data": {
- "text/plain": [
- "FY 3609\n",
- "1Q 655\n",
- "2Q 372\n",
- "3Q 281\n",
- "Name: TypeOfCurrentPeriod, dtype: int64"
- ]
- },
- "metadata": {},
- "execution_count": 28
- }
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "4月から6月までの間に通期の開示を行う会社が多いことがわかる "
- ],
- "metadata": {
- "id": "lgDrSCbKQ-fn"
- }
+ "execution_count": null,
+ "outputs": []
},
{
"cell_type": "code",
@@ -7367,52 +814,17 @@
"df_fins_onlyFY[\"CurrentPeriodEndDate\"].value_counts()\n"
],
"metadata": {
- "colab": {
- "base_uri": "https://localhost:8080/"
- },
- "id": "v9ZFCieEOweK",
- "outputId": "9e5a02d1-901d-4ef5-d65a-fe1197bd9365"
+ "id": "v9ZFCieEOweK"
},
- "execution_count": 29,
- "outputs": [
- {
- "output_type": "execute_result",
- "data": {
- "text/plain": [
- "2022-03-31 2359\n",
- "2022-02-28 222\n",
- "2022-04-30 50\n",
- "2022-03-20 14\n",
- "2022-02-20 5\n",
- "2022-05-15 3\n",
- "2022-05-31 3\n",
- "2022-03-15 2\n",
- "2021-12-31 2\n",
- "2022-04-20 2\n",
- "2022-05-20 1\n",
- "Name: CurrentPeriodEndDate, dtype: int64"
- ]
- },
- "metadata": {},
- "execution_count": 29
- }
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "さらに、特に決算期末が3月末の会社が多い\n"
- ],
- "metadata": {
- "id": "-Xlkb_F5Vca0"
- }
+ "execution_count": null,
+ "outputs": []
},
{
"cell_type": "code",
"source": [
- "# 3月末が事業年度最終日の会社でフィルタ\n",
+ "# 一番多い決算期末の日付でフィルタ\n",
"df_fins_onlyFY_onMar = df_fins_onlyFY[df_fins_onlyFY[\"CurrentPeriodEndDate\"] ==\n",
- " \"2022-03-31\"]\n",
+ " df_fins_onlyFY[\"CurrentPeriodEndDate\"].max().strftime(format(\"%Y%m%d\"))]\n",
"\n",
"# 開示日でグループ化し、開示件数を描画\n",
"df_disclosed_date = df_fins_onlyFY_onMar.groupby(\n",
@@ -7420,55 +832,10 @@
"px.bar(df_disclosed_date, x=\"DisclosedDate\", y=\"Count\", title=\"日ごとの開示件数\")\n"
],
"metadata": {
- "colab": {
- "base_uri": "https://localhost:8080/",
- "height": 0
- },
- "id": "lknuNNqgRVTD",
- "outputId": "5f77fa78-28ee-40dd-ea03-8def19ab99ce"
+ "id": "lknuNNqgRVTD"
},
- "execution_count": 30,
- "outputs": [
- {
- "output_type": "display_data",
- "data": {
- "text/html": [
- "\n",
- " \n",
- "\n",
- " \n",
- "\n",
- ""
- ]
- },
- "metadata": {}
- }
- ]
+ "execution_count": null,
+ "outputs": []
},
{
"cell_type": "markdown",
@@ -7482,8 +849,7 @@
{
"cell_type": "markdown",
"source": [
- "# マーケット情報 API(毎週第4営業日に週次で更新)\n",
- "(注)2022/11/25時点の情報です。\n",
+ "# マーケット情報 API(毎週第4営業日に週次で更新) **(Lightプラン以上のプランの方のみ利用可能)**\n",
"\n",
"2017年1月から足元までの投資部門別売買状況(金額)のデータを取得することができます。 \n",
"なお、配信データは[こちらのページ](https://www.jpx.co.jp/markets/statistics-equities/investor-type/index.html)で公表している内容と同一です。 "
@@ -7492,75 +858,6 @@
"id": "tnIOKgSdX0GV"
}
},
- {
- "cell_type": "markdown",
- "source": [
- "## API出力データ概要\n",
- "\n",
- "\n",
- "|変数名|概要|\n",
- "|---|---|\n",
- "|Section|取引市場名|\n",
- "|PublishedDate|本データの公表日|\n",
- "|StartDate|本データの対象週の週初営業日|\n",
- "|EndDate|本データの対象週の週末営業日|\n",
- "|ProprietarySales|自己_売金額|\n",
- "|ProprietaryPurchases|自己_買金額|\n",
- "|ProprietaryTotal|自己_売買金額合計|\n",
- "|ProprietaryBalance|自己_売買差引金額|\n",
- "|BrokerageSales|委託_売金額|\n",
- "|BrokeragePurchases|委託_買金額|\n",
- "|BrokerageTotal|委託_売買金額合計|\n",
- "|BrokerageBalance|委託_売買差引金額|\n",
- "|TotalSales|総合計_売金額|\n",
- "|TotalPurchases|総合計_買金額|\n",
- "|TotalTotal|総合計_売買金額合計\n",
- "|TotalBalance|総合計_売買差引金額|\n",
- "|IndividualsSales|国内個人投資家_売金額|\n",
- "|IndividualsPurchases|国内個人投資家_買金額|\n",
- "|IndividualsTotal|国内個人投資家_売買金額合計|\n",
- "|IndividualsBalance|国内個人投資家_売買差引金額|\n",
- "|ForeignersSales|海外投資家_売金額|\n",
- "|ForeignersPurchases|海外投資家_買金額|\n",
- "|ForeignersTotal|海外投資家_売買金額合計|\n",
- "|ForeignersBalance|海外投資家_売買差引金額|\n",
- "|SecuritiesCosSales|証券会社_売金額|\n",
- "|SecuritiesCosPurchases|証券会社_買金額|\n",
- "|SecuritiesCosTotal|証券会社_売買金額合計|\n",
- "|SecuritiesCosBalance|証券会社_売買差引金額|\n",
- "|InvestmentTrustsSales|投資信託_売金額|\n",
- "|InvestmentTrustsPurchases|投資信託_買金額|\n",
- "|InvestmentTrustsTotal|投資信託_売買金額合計|\n",
- "|InvestmentTrustsBalance|投資信託_売買差引金額|\n",
- "|BusinessCosSales|事業法人_売金額|\n",
- "|BusinessCosPurchases|事業法人_買金額|\n",
- "|BusinessCosTotal|事業法人_売買金額合計|\n",
- "|BusinessCosBalance|事業法人_売買差引金額|\n",
- "|OtherCosSales|その他法人_売金額|\n",
- "|OtherCosPurchases|その他法人_買金額|\n",
- "|OtherCosTotal|その他法人_売買金額合計|\n",
- "|OtherCosBalance|その他法人_売買差引金額|\n",
- "|InsuranceCosSales|生損保_売金額|\n",
- "|InsuranceCosPurchases|生損保_買金額|\n",
- "|InsuranceCosTotal|生損保_売買金額合計|\n",
- "|InsuranceCosBalance|生損保_売買差引金額|\n",
- "|CityBKsRegionalBKsEtcSales|都銀・地銀_売金額|\n",
- "|CityBKsRegionalBKsEtcPurchases|都銀・地銀_買金額|\n",
- "|CityBKsRegionalBKsEtcTotal|都銀・地銀_売買金額合計|\n",
- "|CityBKsRegionalBKsEtcBalance|都銀・地銀_売買差引金額|\n",
- "|TrustBanksSales|信託銀行_売金額|\n",
- "|TrustBanksPurchases|信託銀行_買金額|\n",
- "|TrustBanksTotal|信託銀行_売買金額合計|\n",
- "|TrustBanksBalance|信託銀行_売買差引金額\n",
- "|OtherFinancialInstitutionsSales|その他金融機関_売金額|\n",
- "|OtherFinancialInstitutionsPurchases|その他金融機関_買金額|\n",
- "|OtherFinancialInstitutionsTotal|その他金融機関_売買金額合計|\n",
- "|OtherFinancialInstitutionsBalance|その他金融機関_売買差引金額|"
- ],
- "metadata": {
- "id": "ecAqsdfLX0GV"
- }
- },
{
"cell_type": "code",
"source": [
@@ -7575,1155 +872,10 @@
"df_trades_spec\n"
],
"metadata": {
- "colab": {
- "base_uri": "https://localhost:8080/",
- "height": 1000
- },
- "id": "Re_RHFAbX0GW",
- "outputId": "7852c11f-a5e9-4893-d95f-1bd55273ffad"
+ "id": "Re_RHFAbX0GW"
},
- "execution_count": 31,
- "outputs": [
- {
- "output_type": "stream",
- "name": "stdout",
- "text": [
- "\n",
- "Int64Index: 1493 entries, 3 to 1491\n",
- "Data columns (total 56 columns):\n",
- " # Column Non-Null Count Dtype \n",
- "--- ------ -------------- ----- \n",
- " 0 Section 1493 non-null object \n",
- " 1 PublishedDate 1493 non-null datetime64[ns]\n",
- " 2 StartDate 1493 non-null datetime64[ns]\n",
- " 3 EndDate 1493 non-null datetime64[ns]\n",
- " 4 ProprietarySales 1493 non-null float64 \n",
- " 5 ProprietaryPurchases 1493 non-null float64 \n",
- " 6 ProprietaryTotal 1493 non-null float64 \n",
- " 7 ProprietaryBalance 1493 non-null float64 \n",
- " 8 BrokerageSales 1493 non-null float64 \n",
- " 9 BrokeragePurchases 1493 non-null float64 \n",
- " 10 BrokerageTotal 1493 non-null float64 \n",
- " 11 BrokerageBalance 1493 non-null float64 \n",
- " 12 TotalSales 1493 non-null float64 \n",
- " 13 TotalPurchases 1493 non-null float64 \n",
- " 14 TotalTotal 1493 non-null float64 \n",
- " 15 TotalBalance 1493 non-null float64 \n",
- " 16 IndividualsSales 1493 non-null float64 \n",
- " 17 IndividualsPurchases 1493 non-null float64 \n",
- " 18 IndividualsTotal 1493 non-null float64 \n",
- " 19 IndividualsBalance 1493 non-null float64 \n",
- " 20 ForeignersSales 1493 non-null float64 \n",
- " 21 ForeignersPurchases 1493 non-null float64 \n",
- " 22 ForeignersTotal 1493 non-null float64 \n",
- " 23 ForeignersBalance 1493 non-null float64 \n",
- " 24 SecuritiesCosSales 1493 non-null float64 \n",
- " 25 SecuritiesCosPurchases 1493 non-null float64 \n",
- " 26 SecuritiesCosTotal 1493 non-null float64 \n",
- " 27 SecuritiesCosBalance 1493 non-null float64 \n",
- " 28 InvestmentTrustsSales 1493 non-null float64 \n",
- " 29 InvestmentTrustsPurchases 1493 non-null float64 \n",
- " 30 InvestmentTrustsTotal 1493 non-null float64 \n",
- " 31 InvestmentTrustsBalance 1493 non-null float64 \n",
- " 32 BusinessCosSales 1493 non-null float64 \n",
- " 33 BusinessCosPurchases 1493 non-null float64 \n",
- " 34 BusinessCosTotal 1493 non-null float64 \n",
- " 35 BusinessCosBalance 1493 non-null float64 \n",
- " 36 OtherCosSales 1493 non-null float64 \n",
- " 37 OtherCosPurchases 1493 non-null float64 \n",
- " 38 OtherCosTotal 1493 non-null float64 \n",
- " 39 OtherCosBalance 1493 non-null float64 \n",
- " 40 InsuranceCosSales 1493 non-null float64 \n",
- " 41 InsuranceCosPurchases 1493 non-null float64 \n",
- " 42 InsuranceCosTotal 1493 non-null float64 \n",
- " 43 InsuranceCosBalance 1493 non-null float64 \n",
- " 44 CityBKsRegionalBKsEtcSales 1493 non-null float64 \n",
- " 45 CityBKsRegionalBKsEtcPurchases 1493 non-null float64 \n",
- " 46 CityBKsRegionalBKsEtcTotal 1493 non-null float64 \n",
- " 47 CityBKsRegionalBKsEtcBalance 1493 non-null float64 \n",
- " 48 TrustBanksSales 1493 non-null float64 \n",
- " 49 TrustBanksPurchases 1493 non-null float64 \n",
- " 50 TrustBanksTotal 1493 non-null float64 \n",
- " 51 TrustBanksBalance 1493 non-null float64 \n",
- " 52 OtherFinancialInstitutionsSales 1493 non-null float64 \n",
- " 53 OtherFinancialInstitutionsPurchases 1493 non-null float64 \n",
- " 54 OtherFinancialInstitutionsTotal 1493 non-null float64 \n",
- " 55 OtherFinancialInstitutionsBalance 1493 non-null float64 \n",
- "dtypes: datetime64[ns](3), float64(52), object(1)\n",
- "memory usage: 664.9+ KB\n",
- "\n",
- "\n"
- ]
- },
- {
- "output_type": "execute_result",
- "data": {
- "text/plain": [
- " Section PublishedDate StartDate EndDate ProprietarySales \\\n",
- "3 TSE1st 2017-01-13 2017-01-04 2017-01-06 1.311271e+09 \n",
- "2 TSE2nd 2017-01-13 2017-01-04 2017-01-06 1.309361e+07 \n",
- "1 TSEJASDAQ 2017-01-13 2017-01-04 2017-01-06 4.949104e+06 \n",
- "4 TSEMothers 2017-01-13 2017-01-04 2017-01-06 1.110837e+07 \n",
- "0 TokyoNagoya 2017-01-13 2017-01-04 2017-01-06 1.340438e+09 \n",
- "... ... ... ... ... ... \n",
- "1487 TokyoNagoya 2022-11-10 2022-10-31 2022-11-04 2.394993e+09 \n",
- "1489 TSEGrowth 2022-11-17 2022-11-07 2022-11-11 2.440619e+07 \n",
- "1492 TSEPrime 2022-11-17 2022-11-07 2022-11-11 2.097301e+09 \n",
- "1490 TSEStandard 2022-11-17 2022-11-07 2022-11-11 2.423198e+07 \n",
- "1491 TokyoNagoya 2022-11-17 2022-11-07 2022-11-11 2.145961e+09 \n",
- "\n",
- " ProprietaryPurchases ProprietaryTotal ProprietaryBalance \\\n",
- "3 1.453327e+09 2.764598e+09 142055504.0 \n",
- "2 6.535935e+06 1.962954e+07 -6557672.0 \n",
- "1 4.193588e+06 9.142692e+06 -755516.0 \n",
- "4 8.629083e+06 1.973745e+07 -2479283.0 \n",
- "0 1.472728e+09 2.813166e+09 132290383.0 \n",
- "... ... ... ... \n",
- "1487 1.815105e+09 4.210098e+09 -579888234.0 \n",
- "1489 2.995495e+07 5.436114e+07 5548767.0 \n",
- "1492 2.142499e+09 4.239801e+09 45197679.0 \n",
- "1490 2.396334e+07 4.819532e+07 -268640.0 \n",
- "1491 2.196438e+09 4.342399e+09 50476776.0 \n",
- "\n",
- " BrokerageSales BrokeragePurchases BrokerageTotal BrokerageBalance \\\n",
- "3 7.165529e+09 7.030020e+09 1.419555e+10 -135509151.0 \n",
- "2 2.092613e+08 2.152348e+08 4.244960e+08 5973519.0 \n",
- "1 1.416962e+08 1.422985e+08 2.839947e+08 602320.0 \n",
- "4 3.014538e+08 3.042051e+08 6.056589e+08 2751341.0 \n",
- "0 7.819145e+09 7.692945e+09 1.551209e+10 -126199641.0 \n",
- "... ... ... ... ... \n",
- "1487 1.389875e+10 1.449049e+10 2.838924e+10 591739148.0 \n",
- "1489 6.583420e+08 6.568187e+08 1.315161e+09 -1523309.0 \n",
- "1492 1.724874e+10 1.722988e+10 3.447862e+10 -18866011.0 \n",
- "1490 4.298038e+08 4.310501e+08 8.608539e+08 1246283.0 \n",
- "1491 1.833846e+10 1.831933e+10 3.665779e+10 -19126070.0 \n",
- "\n",
- " TotalSales TotalPurchases TotalTotal TotalBalance \\\n",
- "3 8.476800e+09 8.483346e+09 1.696015e+10 6546353.0 \n",
- "2 2.223549e+08 2.217707e+08 4.441256e+08 -584153.0 \n",
- "1 1.466453e+08 1.464921e+08 2.931374e+08 -153196.0 \n",
- "4 3.125621e+08 3.128342e+08 6.253963e+08 272058.0 \n",
- "0 9.159583e+09 9.165674e+09 1.832526e+10 6090742.0 \n",
- "... ... ... ... ... \n",
- "1487 1.629374e+10 1.630559e+10 3.259934e+10 11850914.0 \n",
- "1489 6.827482e+08 6.867736e+08 1.369522e+09 4025458.0 \n",
- "1492 1.934604e+10 1.937238e+10 3.871842e+10 26331668.0 \n",
- "1490 4.540358e+08 4.550134e+08 9.090492e+08 977643.0 \n",
- "1491 2.048442e+10 2.051577e+10 4.100019e+10 31350706.0 \n",
- "\n",
- " IndividualsSales IndividualsPurchases IndividualsTotal \\\n",
- "3 1.401712e+09 1.161801e+09 2.563513e+09 \n",
- "2 1.224825e+08 1.239568e+08 2.464393e+08 \n",
- "1 1.000472e+08 9.806762e+07 1.981148e+08 \n",
- "4 2.042972e+08 2.023668e+08 4.066639e+08 \n",
- "0 1.829215e+09 1.586814e+09 3.416028e+09 \n",
- "... ... ... ... \n",
- "1487 3.337061e+09 3.243882e+09 6.580942e+09 \n",
- "1489 3.727606e+08 3.610436e+08 7.338042e+08 \n",
- "1492 4.501096e+09 3.868148e+09 8.369244e+09 \n",
- "1490 1.973267e+08 1.914895e+08 3.888162e+08 \n",
- "1491 5.072556e+09 4.422149e+09 9.494705e+09 \n",
- "\n",
- " IndividualsBalance ForeignersSales ForeignersPurchases \\\n",
- "3 -239910460.0 5.094892e+09 5.317152e+09 \n",
- "2 1474255.0 7.623919e+07 8.047202e+07 \n",
- "1 -1979577.0 3.205425e+07 3.438530e+07 \n",
- "4 -1930418.0 8.185699e+07 8.562572e+07 \n",
- "0 -242401144.0 5.285399e+09 5.518022e+09 \n",
- "... ... ... ... \n",
- "1487 -93179237.0 9.639261e+09 1.002970e+10 \n",
- "1489 -11717044.0 2.629781e+08 2.751938e+08 \n",
- "1492 -632947829.0 1.170302e+10 1.220612e+10 \n",
- "1490 -5837230.0 2.113342e+08 2.170655e+08 \n",
- "1491 -650406352.0 1.217741e+10 1.269839e+10 \n",
- "\n",
- " ForeignersTotal ForeignersBalance SecuritiesCosSales \\\n",
- "3 1.041204e+10 222260039.0 76381455.0 \n",
- "2 1.567112e+08 4232828.0 6051426.0 \n",
- "1 6.643955e+07 2331056.0 4653575.0 \n",
- "4 1.674827e+08 3768728.0 7397443.0 \n",
- "0 1.080342e+10 232623007.0 94500941.0 \n",
- "... ... ... ... \n",
- "1487 1.966896e+10 390440537.0 80291538.0 \n",
- "1489 5.381719e+08 12215711.0 6859937.0 \n",
- "1492 2.390914e+10 503098487.0 115412046.0 \n",
- "1490 4.283997e+08 5731260.0 4939779.0 \n",
- "1491 2.487580e+10 520983571.0 127235055.0 \n",
- "\n",
- " SecuritiesCosPurchases SecuritiesCosTotal SecuritiesCosBalance \\\n",
- "3 61700100.0 138081555.0 -14681355.0 \n",
- "2 5778242.0 11829668.0 -273184.0 \n",
- "1 4334909.0 8988484.0 -318666.0 \n",
- "4 6906340.0 14303783.0 -491103.0 \n",
- "0 78768114.0 173269055.0 -15732827.0 \n",
- "... ... ... ... \n",
- "1487 69134983.0 149426521.0 -11156555.0 \n",
- "1489 5906201.0 12766138.0 -953736.0 \n",
- "1492 89890415.0 205302461.0 -25521631.0 \n",
- "1490 4744117.0 9683896.0 -195662.0 \n",
- "1491 100560677.0 227795732.0 -26674378.0 \n",
- "\n",
- " InvestmentTrustsSales InvestmentTrustsPurchases InvestmentTrustsTotal \\\n",
- "3 168705109.0 124389642.0 293094751.0 \n",
- "2 600795.0 694595.0 1295390.0 \n",
- "1 1099405.0 1336156.0 2435561.0 \n",
- "4 805816.0 1837203.0 2643019.0 \n",
- "0 171266407.0 128280714.0 299547121.0 \n",
- "... ... ... ... \n",
- "1487 236863365.0 435161651.0 672025016.0 \n",
- "1489 4273678.0 2776043.0 7049721.0 \n",
- "1492 312658622.0 291184841.0 603843463.0 \n",
- "1490 4140266.0 3507349.0 7647615.0 \n",
- "1491 321079737.0 297468283.0 618548020.0 \n",
- "\n",
- " InvestmentTrustsBalance BusinessCosSales BusinessCosPurchases \\\n",
- "3 -44315467.0 71217959.0 63526641.0 \n",
- "2 93800.0 2139840.0 1980229.0 \n",
- "1 236751.0 1437706.0 1453605.0 \n",
- "4 1031387.0 3524194.0 3405887.0 \n",
- "0 -42985693.0 78352044.0 70374877.0 \n",
- "... ... ... ... \n",
- "1487 198298286.0 160883346.0 295370810.0 \n",
- "1489 -1497635.0 5407869.0 5564685.0 \n",
- "1492 -21473781.0 219679792.0 309936213.0 \n",
- "1490 -632917.0 6222512.0 8780618.0 \n",
- "1491 -23611454.0 231391656.0 324353192.0 \n",
- "\n",
- " BusinessCosTotal BusinessCosBalance OtherCosSales OtherCosPurchases \\\n",
- "3 134744600.0 -7691318.0 10745152.0 15687836.0 \n",
- "2 4120069.0 -159611.0 314555.0 494071.0 \n",
- "1 2891311.0 15899.0 244023.0 342691.0 \n",
- "4 6930081.0 -118307.0 870179.0 489709.0 \n",
- "0 148726921.0 -7977167.0 12185795.0 17106799.0 \n",
- "... ... ... ... ... \n",
- "1487 456254156.0 134487464.0 42639347.0 35285865.0 \n",
- "1489 10972554.0 156816.0 2984059.0 2444143.0 \n",
- "1492 529616005.0 90256421.0 47262400.0 43472505.0 \n",
- "1490 15003130.0 2558106.0 600436.0 976584.0 \n",
- "1491 555744848.0 92961536.0 50855262.0 46907299.0 \n",
- "\n",
- " OtherCosTotal OtherCosBalance InsuranceCosSales \\\n",
- "3 26432988.0 4942684.0 15926202.0 \n",
- "2 808626.0 179516.0 19636.0 \n",
- "1 586714.0 98668.0 14484.0 \n",
- "4 1359888.0 -380470.0 6691.0 \n",
- "0 29292594.0 4921004.0 15968397.0 \n",
- "... ... ... ... \n",
- "1487 77925212.0 -7353482.0 20049551.0 \n",
- "1489 5428202.0 -539916.0 40008.0 \n",
- "1492 90734905.0 -3789895.0 22225795.0 \n",
- "1490 1577020.0 376148.0 232060.0 \n",
- "1491 97762561.0 -3947963.0 22499593.0 \n",
- "\n",
- " InsuranceCosPurchases InsuranceCosTotal InsuranceCosBalance \\\n",
- "3 9831555.0 25757757.0 -6094647.0 \n",
- "2 12986.0 32622.0 -6650.0 \n",
- "1 318.0 14802.0 -14166.0 \n",
- "4 4024.0 10715.0 -2667.0 \n",
- "0 9848883.0 25817280.0 -6119514.0 \n",
- "... ... ... ... \n",
- "1487 11065024.0 31114575.0 -8984527.0 \n",
- "1489 27852.0 67860.0 -12156.0 \n",
- "1492 4728776.0 26954571.0 -17497019.0 \n",
- "1490 80694.0 312754.0 -151366.0 \n",
- "1491 4837324.0 27336917.0 -17662269.0 \n",
- "\n",
- " CityBKsRegionalBKsEtcSales CityBKsRegionalBKsEtcPurchases \\\n",
- "3 10606789.0 8843871.0 \n",
- "2 36866.0 2301.0 \n",
- "1 51072.0 2026.0 \n",
- "4 10205.0 36575.0 \n",
- "0 10704934.0 8884774.0 \n",
- "... ... ... \n",
- "1487 18370386.0 5541764.0 \n",
- "1489 747515.0 1169.0 \n",
- "1492 31973572.0 10095671.0 \n",
- "1490 415255.0 33817.0 \n",
- "1491 33137658.0 10130657.0 \n",
- "\n",
- " CityBKsRegionalBKsEtcTotal CityBKsRegionalBKsEtcBalance \\\n",
- "3 19450660.0 -1762918.0 \n",
- "2 39167.0 -34565.0 \n",
- "1 53098.0 -49046.0 \n",
- "4 46780.0 26370.0 \n",
- "0 19589708.0 -1820160.0 \n",
- "... ... ... \n",
- "1487 23912150.0 -12828622.0 \n",
- "1489 748684.0 -746346.0 \n",
- "1492 42069243.0 -21877901.0 \n",
- "1490 449072.0 -381438.0 \n",
- "1491 43268315.0 -23007001.0 \n",
- "\n",
- " TrustBanksSales TrustBanksPurchases TrustBanksTotal \\\n",
- "3 292932297.0 245322795.0 538255092.0 \n",
- "2 1328241.0 1807118.0 3135359.0 \n",
- "1 2077054.0 2271613.0 4348667.0 \n",
- "4 2681157.0 3526373.0 6207530.0 \n",
- "0 299072437.0 252932398.0 552004835.0 \n",
- "... ... ... ... \n",
- "1487 350520957.0 340672593.0 691193550.0 \n",
- "1489 2247754.0 3793497.0 6041251.0 \n",
- "1492 266792216.0 372706535.0 639498751.0 \n",
- "1490 4453611.0 4191706.0 8645317.0 \n",
- "1491 273493720.0 380693460.0 654187180.0 \n",
- "\n",
- " TrustBanksBalance OtherFinancialInstitutionsSales \\\n",
- "3 -47609502.0 22410692.0 \n",
- "2 478877.0 48202.0 \n",
- "1 194559.0 17444.0 \n",
- "4 845216.0 3918.0 \n",
- "0 -46140039.0 22480257.0 \n",
- "... ... ... \n",
- "1487 -9848364.0 12810168.0 \n",
- "1489 1545743.0 42466.0 \n",
- "1492 105914319.0 28620129.0 \n",
- "1490 -261905.0 138971.0 \n",
- "1491 107199740.0 28802817.0 \n",
- "\n",
- " OtherFinancialInstitutionsPurchases OtherFinancialInstitutionsTotal \\\n",
- "3 21764485.0 44175177.0 \n",
- "2 36455.0 84657.0 \n",
- "1 104286.0 121730.0 \n",
- "4 6523.0 10441.0 \n",
- "0 21913149.0 44393406.0 \n",
- "... ... ... \n",
- "1487 24673816.0 37483984.0 \n",
- "1489 67720.0 110186.0 \n",
- "1492 33592947.0 62213076.0 \n",
- "1490 180258.0 319229.0 \n",
- "1491 33841317.0 62644134.0 \n",
- "\n",
- " OtherFinancialInstitutionsBalance \n",
- "3 -646207.0 \n",
- "2 -11747.0 \n",
- "1 86842.0 \n",
- "4 2605.0 \n",
- "0 -567108.0 \n",
- "... ... \n",
- "1487 11863648.0 \n",
- "1489 25254.0 \n",
- "1492 4972818.0 \n",
- "1490 41287.0 \n",
- "1491 5038500.0 \n",
- "\n",
- "[1493 rows x 56 columns]"
- ],
- "text/html": [
- "\n",
- " \n",
- "
\n",
- "
\n",
- "\n",
- "
\n",
- " \n",
- " \n",
- " \n",
- " Section \n",
- " PublishedDate \n",
- " StartDate \n",
- " EndDate \n",
- " ProprietarySales \n",
- " ProprietaryPurchases \n",
- " ProprietaryTotal \n",
- " ProprietaryBalance \n",
- " BrokerageSales \n",
- " BrokeragePurchases \n",
- " BrokerageTotal \n",
- " BrokerageBalance \n",
- " TotalSales \n",
- " TotalPurchases \n",
- " TotalTotal \n",
- " TotalBalance \n",
- " IndividualsSales \n",
- " IndividualsPurchases \n",
- " IndividualsTotal \n",
- " IndividualsBalance \n",
- " ForeignersSales \n",
- " ForeignersPurchases \n",
- " ForeignersTotal \n",
- " ForeignersBalance \n",
- " SecuritiesCosSales \n",
- " SecuritiesCosPurchases \n",
- " SecuritiesCosTotal \n",
- " SecuritiesCosBalance \n",
- " InvestmentTrustsSales \n",
- " InvestmentTrustsPurchases \n",
- " InvestmentTrustsTotal \n",
- " InvestmentTrustsBalance \n",
- " BusinessCosSales \n",
- " BusinessCosPurchases \n",
- " BusinessCosTotal \n",
- " BusinessCosBalance \n",
- " OtherCosSales \n",
- " OtherCosPurchases \n",
- " OtherCosTotal \n",
- " OtherCosBalance \n",
- " InsuranceCosSales \n",
- " InsuranceCosPurchases \n",
- " InsuranceCosTotal \n",
- " InsuranceCosBalance \n",
- " CityBKsRegionalBKsEtcSales \n",
- " CityBKsRegionalBKsEtcPurchases \n",
- " CityBKsRegionalBKsEtcTotal \n",
- " CityBKsRegionalBKsEtcBalance \n",
- " TrustBanksSales \n",
- " TrustBanksPurchases \n",
- " TrustBanksTotal \n",
- " TrustBanksBalance \n",
- " OtherFinancialInstitutionsSales \n",
- " OtherFinancialInstitutionsPurchases \n",
- " OtherFinancialInstitutionsTotal \n",
- " OtherFinancialInstitutionsBalance \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " 3 \n",
- " TSE1st \n",
- " 2017-01-13 \n",
- " 2017-01-04 \n",
- " 2017-01-06 \n",
- " 1.311271e+09 \n",
- " 1.453327e+09 \n",
- " 2.764598e+09 \n",
- " 142055504.0 \n",
- " 7.165529e+09 \n",
- " 7.030020e+09 \n",
- " 1.419555e+10 \n",
- " -135509151.0 \n",
- " 8.476800e+09 \n",
- " 8.483346e+09 \n",
- " 1.696015e+10 \n",
- " 6546353.0 \n",
- " 1.401712e+09 \n",
- " 1.161801e+09 \n",
- " 2.563513e+09 \n",
- " -239910460.0 \n",
- " 5.094892e+09 \n",
- " 5.317152e+09 \n",
- " 1.041204e+10 \n",
- " 222260039.0 \n",
- " 76381455.0 \n",
- " 61700100.0 \n",
- " 138081555.0 \n",
- " -14681355.0 \n",
- " 168705109.0 \n",
- " 124389642.0 \n",
- " 293094751.0 \n",
- " -44315467.0 \n",
- " 71217959.0 \n",
- " 63526641.0 \n",
- " 134744600.0 \n",
- " -7691318.0 \n",
- " 10745152.0 \n",
- " 15687836.0 \n",
- " 26432988.0 \n",
- " 4942684.0 \n",
- " 15926202.0 \n",
- " 9831555.0 \n",
- " 25757757.0 \n",
- " -6094647.0 \n",
- " 10606789.0 \n",
- " 8843871.0 \n",
- " 19450660.0 \n",
- " -1762918.0 \n",
- " 292932297.0 \n",
- " 245322795.0 \n",
- " 538255092.0 \n",
- " -47609502.0 \n",
- " 22410692.0 \n",
- " 21764485.0 \n",
- " 44175177.0 \n",
- " -646207.0 \n",
- " \n",
- " \n",
- " 2 \n",
- " TSE2nd \n",
- " 2017-01-13 \n",
- " 2017-01-04 \n",
- " 2017-01-06 \n",
- " 1.309361e+07 \n",
- " 6.535935e+06 \n",
- " 1.962954e+07 \n",
- " -6557672.0 \n",
- " 2.092613e+08 \n",
- " 2.152348e+08 \n",
- " 4.244960e+08 \n",
- " 5973519.0 \n",
- " 2.223549e+08 \n",
- " 2.217707e+08 \n",
- " 4.441256e+08 \n",
- " -584153.0 \n",
- " 1.224825e+08 \n",
- " 1.239568e+08 \n",
- " 2.464393e+08 \n",
- " 1474255.0 \n",
- " 7.623919e+07 \n",
- " 8.047202e+07 \n",
- " 1.567112e+08 \n",
- " 4232828.0 \n",
- " 6051426.0 \n",
- " 5778242.0 \n",
- " 11829668.0 \n",
- " -273184.0 \n",
- " 600795.0 \n",
- " 694595.0 \n",
- " 1295390.0 \n",
- " 93800.0 \n",
- " 2139840.0 \n",
- " 1980229.0 \n",
- " 4120069.0 \n",
- " -159611.0 \n",
- " 314555.0 \n",
- " 494071.0 \n",
- " 808626.0 \n",
- " 179516.0 \n",
- " 19636.0 \n",
- " 12986.0 \n",
- " 32622.0 \n",
- " -6650.0 \n",
- " 36866.0 \n",
- " 2301.0 \n",
- " 39167.0 \n",
- " -34565.0 \n",
- " 1328241.0 \n",
- " 1807118.0 \n",
- " 3135359.0 \n",
- " 478877.0 \n",
- " 48202.0 \n",
- " 36455.0 \n",
- " 84657.0 \n",
- " -11747.0 \n",
- " \n",
- " \n",
- " 1 \n",
- " TSEJASDAQ \n",
- " 2017-01-13 \n",
- " 2017-01-04 \n",
- " 2017-01-06 \n",
- " 4.949104e+06 \n",
- " 4.193588e+06 \n",
- " 9.142692e+06 \n",
- " -755516.0 \n",
- " 1.416962e+08 \n",
- " 1.422985e+08 \n",
- " 2.839947e+08 \n",
- " 602320.0 \n",
- " 1.466453e+08 \n",
- " 1.464921e+08 \n",
- " 2.931374e+08 \n",
- " -153196.0 \n",
- " 1.000472e+08 \n",
- " 9.806762e+07 \n",
- " 1.981148e+08 \n",
- " -1979577.0 \n",
- " 3.205425e+07 \n",
- " 3.438530e+07 \n",
- " 6.643955e+07 \n",
- " 2331056.0 \n",
- " 4653575.0 \n",
- " 4334909.0 \n",
- " 8988484.0 \n",
- " -318666.0 \n",
- " 1099405.0 \n",
- " 1336156.0 \n",
- " 2435561.0 \n",
- " 236751.0 \n",
- " 1437706.0 \n",
- " 1453605.0 \n",
- " 2891311.0 \n",
- " 15899.0 \n",
- " 244023.0 \n",
- " 342691.0 \n",
- " 586714.0 \n",
- " 98668.0 \n",
- " 14484.0 \n",
- " 318.0 \n",
- " 14802.0 \n",
- " -14166.0 \n",
- " 51072.0 \n",
- " 2026.0 \n",
- " 53098.0 \n",
- " -49046.0 \n",
- " 2077054.0 \n",
- " 2271613.0 \n",
- " 4348667.0 \n",
- " 194559.0 \n",
- " 17444.0 \n",
- " 104286.0 \n",
- " 121730.0 \n",
- " 86842.0 \n",
- " \n",
- " \n",
- " 4 \n",
- " TSEMothers \n",
- " 2017-01-13 \n",
- " 2017-01-04 \n",
- " 2017-01-06 \n",
- " 1.110837e+07 \n",
- " 8.629083e+06 \n",
- " 1.973745e+07 \n",
- " -2479283.0 \n",
- " 3.014538e+08 \n",
- " 3.042051e+08 \n",
- " 6.056589e+08 \n",
- " 2751341.0 \n",
- " 3.125621e+08 \n",
- " 3.128342e+08 \n",
- " 6.253963e+08 \n",
- " 272058.0 \n",
- " 2.042972e+08 \n",
- " 2.023668e+08 \n",
- " 4.066639e+08 \n",
- " -1930418.0 \n",
- " 8.185699e+07 \n",
- " 8.562572e+07 \n",
- " 1.674827e+08 \n",
- " 3768728.0 \n",
- " 7397443.0 \n",
- " 6906340.0 \n",
- " 14303783.0 \n",
- " -491103.0 \n",
- " 805816.0 \n",
- " 1837203.0 \n",
- " 2643019.0 \n",
- " 1031387.0 \n",
- " 3524194.0 \n",
- " 3405887.0 \n",
- " 6930081.0 \n",
- " -118307.0 \n",
- " 870179.0 \n",
- " 489709.0 \n",
- " 1359888.0 \n",
- " -380470.0 \n",
- " 6691.0 \n",
- " 4024.0 \n",
- " 10715.0 \n",
- " -2667.0 \n",
- " 10205.0 \n",
- " 36575.0 \n",
- " 46780.0 \n",
- " 26370.0 \n",
- " 2681157.0 \n",
- " 3526373.0 \n",
- " 6207530.0 \n",
- " 845216.0 \n",
- " 3918.0 \n",
- " 6523.0 \n",
- " 10441.0 \n",
- " 2605.0 \n",
- " \n",
- " \n",
- " 0 \n",
- " TokyoNagoya \n",
- " 2017-01-13 \n",
- " 2017-01-04 \n",
- " 2017-01-06 \n",
- " 1.340438e+09 \n",
- " 1.472728e+09 \n",
- " 2.813166e+09 \n",
- " 132290383.0 \n",
- " 7.819145e+09 \n",
- " 7.692945e+09 \n",
- " 1.551209e+10 \n",
- " -126199641.0 \n",
- " 9.159583e+09 \n",
- " 9.165674e+09 \n",
- " 1.832526e+10 \n",
- " 6090742.0 \n",
- " 1.829215e+09 \n",
- " 1.586814e+09 \n",
- " 3.416028e+09 \n",
- " -242401144.0 \n",
- " 5.285399e+09 \n",
- " 5.518022e+09 \n",
- " 1.080342e+10 \n",
- " 232623007.0 \n",
- " 94500941.0 \n",
- " 78768114.0 \n",
- " 173269055.0 \n",
- " -15732827.0 \n",
- " 171266407.0 \n",
- " 128280714.0 \n",
- " 299547121.0 \n",
- " -42985693.0 \n",
- " 78352044.0 \n",
- " 70374877.0 \n",
- " 148726921.0 \n",
- " -7977167.0 \n",
- " 12185795.0 \n",
- " 17106799.0 \n",
- " 29292594.0 \n",
- " 4921004.0 \n",
- " 15968397.0 \n",
- " 9848883.0 \n",
- " 25817280.0 \n",
- " -6119514.0 \n",
- " 10704934.0 \n",
- " 8884774.0 \n",
- " 19589708.0 \n",
- " -1820160.0 \n",
- " 299072437.0 \n",
- " 252932398.0 \n",
- " 552004835.0 \n",
- " -46140039.0 \n",
- " 22480257.0 \n",
- " 21913149.0 \n",
- " 44393406.0 \n",
- " -567108.0 \n",
- " \n",
- " \n",
- " ... \n",
- " ... \n",
- " ... \n",
- " ... \n",
- " ... \n",
- " ... \n",
- " ... \n",
- " ... \n",
- " ... \n",
- " ... \n",
- " ... \n",
- " ... \n",
- " ... \n",
- " ... \n",
- " ... \n",
- " ... \n",
- " ... \n",
- " ... \n",
- " ... \n",
- " ... \n",
- " ... \n",
- " ... \n",
- " ... \n",
- " ... \n",
- " ... \n",
- " ... \n",
- " ... \n",
- " ... \n",
- " ... \n",
- " ... \n",
- " ... \n",
- " ... \n",
- " ... \n",
- " ... \n",
- " ... \n",
- " ... \n",
- " ... \n",
- " ... \n",
- " ... \n",
- " ... \n",
- " ... \n",
- " ... \n",
- " ... \n",
- " ... \n",
- " ... \n",
- " ... \n",
- " ... \n",
- " ... \n",
- " ... \n",
- " ... \n",
- " ... \n",
- " ... \n",
- " ... \n",
- " ... \n",
- " ... \n",
- " ... \n",
- " ... \n",
- " \n",
- " \n",
- " 1487 \n",
- " TokyoNagoya \n",
- " 2022-11-10 \n",
- " 2022-10-31 \n",
- " 2022-11-04 \n",
- " 2.394993e+09 \n",
- " 1.815105e+09 \n",
- " 4.210098e+09 \n",
- " -579888234.0 \n",
- " 1.389875e+10 \n",
- " 1.449049e+10 \n",
- " 2.838924e+10 \n",
- " 591739148.0 \n",
- " 1.629374e+10 \n",
- " 1.630559e+10 \n",
- " 3.259934e+10 \n",
- " 11850914.0 \n",
- " 3.337061e+09 \n",
- " 3.243882e+09 \n",
- " 6.580942e+09 \n",
- " -93179237.0 \n",
- " 9.639261e+09 \n",
- " 1.002970e+10 \n",
- " 1.966896e+10 \n",
- " 390440537.0 \n",
- " 80291538.0 \n",
- " 69134983.0 \n",
- " 149426521.0 \n",
- " -11156555.0 \n",
- " 236863365.0 \n",
- " 435161651.0 \n",
- " 672025016.0 \n",
- " 198298286.0 \n",
- " 160883346.0 \n",
- " 295370810.0 \n",
- " 456254156.0 \n",
- " 134487464.0 \n",
- " 42639347.0 \n",
- " 35285865.0 \n",
- " 77925212.0 \n",
- " -7353482.0 \n",
- " 20049551.0 \n",
- " 11065024.0 \n",
- " 31114575.0 \n",
- " -8984527.0 \n",
- " 18370386.0 \n",
- " 5541764.0 \n",
- " 23912150.0 \n",
- " -12828622.0 \n",
- " 350520957.0 \n",
- " 340672593.0 \n",
- " 691193550.0 \n",
- " -9848364.0 \n",
- " 12810168.0 \n",
- " 24673816.0 \n",
- " 37483984.0 \n",
- " 11863648.0 \n",
- " \n",
- " \n",
- " 1489 \n",
- " TSEGrowth \n",
- " 2022-11-17 \n",
- " 2022-11-07 \n",
- " 2022-11-11 \n",
- " 2.440619e+07 \n",
- " 2.995495e+07 \n",
- " 5.436114e+07 \n",
- " 5548767.0 \n",
- " 6.583420e+08 \n",
- " 6.568187e+08 \n",
- " 1.315161e+09 \n",
- " -1523309.0 \n",
- " 6.827482e+08 \n",
- " 6.867736e+08 \n",
- " 1.369522e+09 \n",
- " 4025458.0 \n",
- " 3.727606e+08 \n",
- " 3.610436e+08 \n",
- " 7.338042e+08 \n",
- " -11717044.0 \n",
- " 2.629781e+08 \n",
- " 2.751938e+08 \n",
- " 5.381719e+08 \n",
- " 12215711.0 \n",
- " 6859937.0 \n",
- " 5906201.0 \n",
- " 12766138.0 \n",
- " -953736.0 \n",
- " 4273678.0 \n",
- " 2776043.0 \n",
- " 7049721.0 \n",
- " -1497635.0 \n",
- " 5407869.0 \n",
- " 5564685.0 \n",
- " 10972554.0 \n",
- " 156816.0 \n",
- " 2984059.0 \n",
- " 2444143.0 \n",
- " 5428202.0 \n",
- " -539916.0 \n",
- " 40008.0 \n",
- " 27852.0 \n",
- " 67860.0 \n",
- " -12156.0 \n",
- " 747515.0 \n",
- " 1169.0 \n",
- " 748684.0 \n",
- " -746346.0 \n",
- " 2247754.0 \n",
- " 3793497.0 \n",
- " 6041251.0 \n",
- " 1545743.0 \n",
- " 42466.0 \n",
- " 67720.0 \n",
- " 110186.0 \n",
- " 25254.0 \n",
- " \n",
- " \n",
- " 1492 \n",
- " TSEPrime \n",
- " 2022-11-17 \n",
- " 2022-11-07 \n",
- " 2022-11-11 \n",
- " 2.097301e+09 \n",
- " 2.142499e+09 \n",
- " 4.239801e+09 \n",
- " 45197679.0 \n",
- " 1.724874e+10 \n",
- " 1.722988e+10 \n",
- " 3.447862e+10 \n",
- " -18866011.0 \n",
- " 1.934604e+10 \n",
- " 1.937238e+10 \n",
- " 3.871842e+10 \n",
- " 26331668.0 \n",
- " 4.501096e+09 \n",
- " 3.868148e+09 \n",
- " 8.369244e+09 \n",
- " -632947829.0 \n",
- " 1.170302e+10 \n",
- " 1.220612e+10 \n",
- " 2.390914e+10 \n",
- " 503098487.0 \n",
- " 115412046.0 \n",
- " 89890415.0 \n",
- " 205302461.0 \n",
- " -25521631.0 \n",
- " 312658622.0 \n",
- " 291184841.0 \n",
- " 603843463.0 \n",
- " -21473781.0 \n",
- " 219679792.0 \n",
- " 309936213.0 \n",
- " 529616005.0 \n",
- " 90256421.0 \n",
- " 47262400.0 \n",
- " 43472505.0 \n",
- " 90734905.0 \n",
- " -3789895.0 \n",
- " 22225795.0 \n",
- " 4728776.0 \n",
- " 26954571.0 \n",
- " -17497019.0 \n",
- " 31973572.0 \n",
- " 10095671.0 \n",
- " 42069243.0 \n",
- " -21877901.0 \n",
- " 266792216.0 \n",
- " 372706535.0 \n",
- " 639498751.0 \n",
- " 105914319.0 \n",
- " 28620129.0 \n",
- " 33592947.0 \n",
- " 62213076.0 \n",
- " 4972818.0 \n",
- " \n",
- " \n",
- " 1490 \n",
- " TSEStandard \n",
- " 2022-11-17 \n",
- " 2022-11-07 \n",
- " 2022-11-11 \n",
- " 2.423198e+07 \n",
- " 2.396334e+07 \n",
- " 4.819532e+07 \n",
- " -268640.0 \n",
- " 4.298038e+08 \n",
- " 4.310501e+08 \n",
- " 8.608539e+08 \n",
- " 1246283.0 \n",
- " 4.540358e+08 \n",
- " 4.550134e+08 \n",
- " 9.090492e+08 \n",
- " 977643.0 \n",
- " 1.973267e+08 \n",
- " 1.914895e+08 \n",
- " 3.888162e+08 \n",
- " -5837230.0 \n",
- " 2.113342e+08 \n",
- " 2.170655e+08 \n",
- " 4.283997e+08 \n",
- " 5731260.0 \n",
- " 4939779.0 \n",
- " 4744117.0 \n",
- " 9683896.0 \n",
- " -195662.0 \n",
- " 4140266.0 \n",
- " 3507349.0 \n",
- " 7647615.0 \n",
- " -632917.0 \n",
- " 6222512.0 \n",
- " 8780618.0 \n",
- " 15003130.0 \n",
- " 2558106.0 \n",
- " 600436.0 \n",
- " 976584.0 \n",
- " 1577020.0 \n",
- " 376148.0 \n",
- " 232060.0 \n",
- " 80694.0 \n",
- " 312754.0 \n",
- " -151366.0 \n",
- " 415255.0 \n",
- " 33817.0 \n",
- " 449072.0 \n",
- " -381438.0 \n",
- " 4453611.0 \n",
- " 4191706.0 \n",
- " 8645317.0 \n",
- " -261905.0 \n",
- " 138971.0 \n",
- " 180258.0 \n",
- " 319229.0 \n",
- " 41287.0 \n",
- " \n",
- " \n",
- " 1491 \n",
- " TokyoNagoya \n",
- " 2022-11-17 \n",
- " 2022-11-07 \n",
- " 2022-11-11 \n",
- " 2.145961e+09 \n",
- " 2.196438e+09 \n",
- " 4.342399e+09 \n",
- " 50476776.0 \n",
- " 1.833846e+10 \n",
- " 1.831933e+10 \n",
- " 3.665779e+10 \n",
- " -19126070.0 \n",
- " 2.048442e+10 \n",
- " 2.051577e+10 \n",
- " 4.100019e+10 \n",
- " 31350706.0 \n",
- " 5.072556e+09 \n",
- " 4.422149e+09 \n",
- " 9.494705e+09 \n",
- " -650406352.0 \n",
- " 1.217741e+10 \n",
- " 1.269839e+10 \n",
- " 2.487580e+10 \n",
- " 520983571.0 \n",
- " 127235055.0 \n",
- " 100560677.0 \n",
- " 227795732.0 \n",
- " -26674378.0 \n",
- " 321079737.0 \n",
- " 297468283.0 \n",
- " 618548020.0 \n",
- " -23611454.0 \n",
- " 231391656.0 \n",
- " 324353192.0 \n",
- " 555744848.0 \n",
- " 92961536.0 \n",
- " 50855262.0 \n",
- " 46907299.0 \n",
- " 97762561.0 \n",
- " -3947963.0 \n",
- " 22499593.0 \n",
- " 4837324.0 \n",
- " 27336917.0 \n",
- " -17662269.0 \n",
- " 33137658.0 \n",
- " 10130657.0 \n",
- " 43268315.0 \n",
- " -23007001.0 \n",
- " 273493720.0 \n",
- " 380693460.0 \n",
- " 654187180.0 \n",
- " 107199740.0 \n",
- " 28802817.0 \n",
- " 33841317.0 \n",
- " 62644134.0 \n",
- " 5038500.0 \n",
- " \n",
- " \n",
- "
\n",
- "
1493 rows × 56 columns
\n",
- "
\n",
- "
\n",
- " \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " \n",
- "\n",
- " \n",
- "
\n",
- "
\n",
- " "
- ]
- },
- "metadata": {},
- "execution_count": 31
- }
- ]
+ "execution_count": null,
+ "outputs": []
},
{
"cell_type": "code",
@@ -8732,189 +884,10 @@
"df_trades_spec[df_trades_spec.isnull().any(axis=1)]\n"
],
"metadata": {
- "colab": {
- "base_uri": "https://localhost:8080/",
- "height": 113
- },
- "id": "nSv896BR_oIt",
- "outputId": "dbcca63a-091b-4dc6-ca5c-eb856fdef460"
+ "id": "nSv896BR_oIt"
},
- "execution_count": 32,
- "outputs": [
- {
- "output_type": "execute_result",
- "data": {
- "text/plain": [
- "Empty DataFrame\n",
- "Columns: [Section, PublishedDate, StartDate, EndDate, ProprietarySales, ProprietaryPurchases, ProprietaryTotal, ProprietaryBalance, BrokerageSales, BrokeragePurchases, BrokerageTotal, BrokerageBalance, TotalSales, TotalPurchases, TotalTotal, TotalBalance, IndividualsSales, IndividualsPurchases, IndividualsTotal, IndividualsBalance, ForeignersSales, ForeignersPurchases, ForeignersTotal, ForeignersBalance, SecuritiesCosSales, SecuritiesCosPurchases, SecuritiesCosTotal, SecuritiesCosBalance, InvestmentTrustsSales, InvestmentTrustsPurchases, InvestmentTrustsTotal, InvestmentTrustsBalance, BusinessCosSales, BusinessCosPurchases, BusinessCosTotal, BusinessCosBalance, OtherCosSales, OtherCosPurchases, OtherCosTotal, OtherCosBalance, InsuranceCosSales, InsuranceCosPurchases, InsuranceCosTotal, InsuranceCosBalance, CityBKsRegionalBKsEtcSales, CityBKsRegionalBKsEtcPurchases, CityBKsRegionalBKsEtcTotal, CityBKsRegionalBKsEtcBalance, TrustBanksSales, TrustBanksPurchases, TrustBanksTotal, TrustBanksBalance, OtherFinancialInstitutionsSales, OtherFinancialInstitutionsPurchases, OtherFinancialInstitutionsTotal, OtherFinancialInstitutionsBalance]\n",
- "Index: []"
- ],
- "text/html": [
- "\n",
- " \n",
- "
\n",
- "
\n",
- "\n",
- "
\n",
- " \n",
- " \n",
- " \n",
- " Section \n",
- " PublishedDate \n",
- " StartDate \n",
- " EndDate \n",
- " ProprietarySales \n",
- " ProprietaryPurchases \n",
- " ProprietaryTotal \n",
- " ProprietaryBalance \n",
- " BrokerageSales \n",
- " BrokeragePurchases \n",
- " BrokerageTotal \n",
- " BrokerageBalance \n",
- " TotalSales \n",
- " TotalPurchases \n",
- " TotalTotal \n",
- " TotalBalance \n",
- " IndividualsSales \n",
- " IndividualsPurchases \n",
- " IndividualsTotal \n",
- " IndividualsBalance \n",
- " ForeignersSales \n",
- " ForeignersPurchases \n",
- " ForeignersTotal \n",
- " ForeignersBalance \n",
- " SecuritiesCosSales \n",
- " SecuritiesCosPurchases \n",
- " SecuritiesCosTotal \n",
- " SecuritiesCosBalance \n",
- " InvestmentTrustsSales \n",
- " InvestmentTrustsPurchases \n",
- " InvestmentTrustsTotal \n",
- " InvestmentTrustsBalance \n",
- " BusinessCosSales \n",
- " BusinessCosPurchases \n",
- " BusinessCosTotal \n",
- " BusinessCosBalance \n",
- " OtherCosSales \n",
- " OtherCosPurchases \n",
- " OtherCosTotal \n",
- " OtherCosBalance \n",
- " InsuranceCosSales \n",
- " InsuranceCosPurchases \n",
- " InsuranceCosTotal \n",
- " InsuranceCosBalance \n",
- " CityBKsRegionalBKsEtcSales \n",
- " CityBKsRegionalBKsEtcPurchases \n",
- " CityBKsRegionalBKsEtcTotal \n",
- " CityBKsRegionalBKsEtcBalance \n",
- " TrustBanksSales \n",
- " TrustBanksPurchases \n",
- " TrustBanksTotal \n",
- " TrustBanksBalance \n",
- " OtherFinancialInstitutionsSales \n",
- " OtherFinancialInstitutionsPurchases \n",
- " OtherFinancialInstitutionsTotal \n",
- " OtherFinancialInstitutionsBalance \n",
- " \n",
- " \n",
- " \n",
- " \n",
- "
\n",
- "
\n",
- "
\n",
- " \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " \n",
- "\n",
- " \n",
- "
\n",
- "
\n",
- " "
- ]
- },
- "metadata": {},
- "execution_count": 32
- }
- ]
+ "execution_count": null,
+ "outputs": []
},
{
"cell_type": "markdown",
@@ -8954,55 +927,10 @@
"fig.show()\n"
],
"metadata": {
- "colab": {
- "base_uri": "https://localhost:8080/",
- "height": 542
- },
- "id": "jDzZ_UVzD5Ua",
- "outputId": "224cf115-daa5-4a91-b654-5df0fbb0d452"
+ "id": "jDzZ_UVzD5Ua"
},
- "execution_count": 33,
- "outputs": [
- {
- "output_type": "display_data",
- "data": {
- "text/html": [
- "\n",
- " \n",
- "\n",
- " \n",
- "\n",
- ""
- ]
- },
- "metadata": {}
- }
- ]
+ "execution_count": null,
+ "outputs": []
},
{
"cell_type": "code",
@@ -9023,55 +951,10 @@
"fig.show()\n"
],
"metadata": {
- "colab": {
- "base_uri": "https://localhost:8080/",
- "height": 542
- },
- "id": "70w4GZ8YWmpb",
- "outputId": "f7f66be2-df75-461e-a5e1-e3fd7d073486"
+ "id": "70w4GZ8YWmpb"
},
- "execution_count": 34,
- "outputs": [
- {
- "output_type": "display_data",
- "data": {
- "text/html": [
- "\n",
- " \n",
- "\n",
- " \n",
- "\n",
- ""
- ]
- },
- "metadata": {}
- }
- ]
+ "execution_count": null,
+ "outputs": []
},
{
"cell_type": "markdown",
@@ -9087,8 +970,7 @@
{
"cell_type": "markdown",
"source": [
- "# TOPIX指数API\n",
- "(注)2022/11/25時点の情報です。\n",
+ "# TOPIX指数API **(Lightプラン以上のプランの方のみ利用可能)**\n",
"\n",
"2021年1月から足元までのTOPIX指数のデータを取得することができます。 "
],
@@ -9096,23 +978,6 @@
"id": "SDyo1lqF1RV0"
}
},
- {
- "cell_type": "markdown",
- "source": [
- "## API出力データ概要\n",
- "\n",
- "|変数名|概要|\n",
- "|---|---|\n",
- "|Date|日付|\n",
- "|Open|始値|\n",
- "|High|高値|\n",
- "|Low|安値|\n",
- "|Close|終値|"
- ],
- "metadata": {
- "id": "egSRyzyt2Y14"
- }
- },
{
"cell_type": "code",
"source": [
@@ -9127,258 +992,10 @@
"df_topix\n"
],
"metadata": {
- "colab": {
- "base_uri": "https://localhost:8080/",
- "height": 674
- },
- "outputId": "c4cd1461-28ba-4213-d0bc-2932b298a819",
"id": "KjTkuMxs27X4"
},
- "execution_count": 35,
- "outputs": [
- {
- "output_type": "stream",
- "name": "stdout",
- "text": [
- "\n",
- "Int64Index: 463 entries, 0 to 462\n",
- "Data columns (total 5 columns):\n",
- " # Column Non-Null Count Dtype \n",
- "--- ------ -------------- ----- \n",
- " 0 Date 463 non-null datetime64[ns]\n",
- " 1 Open 463 non-null float64 \n",
- " 2 High 463 non-null float64 \n",
- " 3 Low 463 non-null float64 \n",
- " 4 Close 463 non-null float64 \n",
- "dtypes: datetime64[ns](1), float64(4)\n",
- "memory usage: 21.7 KB\n",
- "\n",
- "\n"
- ]
- },
- {
- "output_type": "execute_result",
- "data": {
- "text/plain": [
- " Date Open High Low Close\n",
- "0 2021-01-04 1810.45 1811.68 1776.60 1794.59\n",
- "1 2021-01-05 1788.63 1797.12 1784.80 1791.22\n",
- "2 2021-01-06 1790.86 1802.98 1789.68 1796.18\n",
- "3 2021-01-07 1816.26 1837.50 1816.26 1826.30\n",
- "4 2021-01-08 1832.68 1854.94 1829.05 1854.94\n",
- ".. ... ... ... ... ...\n",
- "458 2022-11-17 1962.79 1972.75 1962.79 1966.28\n",
- "459 2022-11-18 1971.79 1976.33 1966.06 1967.03\n",
- "460 2022-11-21 1972.49 1975.14 1965.64 1972.57\n",
- "461 2022-11-22 1983.10 1998.61 1982.72 1994.75\n",
- "462 2022-11-24 2014.11 2023.39 2013.68 2018.80\n",
- "\n",
- "[463 rows x 5 columns]"
- ],
- "text/html": [
- "\n",
- " \n",
- "
\n",
- "
\n",
- "\n",
- "
\n",
- " \n",
- " \n",
- " \n",
- " Date \n",
- " Open \n",
- " High \n",
- " Low \n",
- " Close \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " 0 \n",
- " 2021-01-04 \n",
- " 1810.45 \n",
- " 1811.68 \n",
- " 1776.60 \n",
- " 1794.59 \n",
- " \n",
- " \n",
- " 1 \n",
- " 2021-01-05 \n",
- " 1788.63 \n",
- " 1797.12 \n",
- " 1784.80 \n",
- " 1791.22 \n",
- " \n",
- " \n",
- " 2 \n",
- " 2021-01-06 \n",
- " 1790.86 \n",
- " 1802.98 \n",
- " 1789.68 \n",
- " 1796.18 \n",
- " \n",
- " \n",
- " 3 \n",
- " 2021-01-07 \n",
- " 1816.26 \n",
- " 1837.50 \n",
- " 1816.26 \n",
- " 1826.30 \n",
- " \n",
- " \n",
- " 4 \n",
- " 2021-01-08 \n",
- " 1832.68 \n",
- " 1854.94 \n",
- " 1829.05 \n",
- " 1854.94 \n",
- " \n",
- " \n",
- " ... \n",
- " ... \n",
- " ... \n",
- " ... \n",
- " ... \n",
- " ... \n",
- " \n",
- " \n",
- " 458 \n",
- " 2022-11-17 \n",
- " 1962.79 \n",
- " 1972.75 \n",
- " 1962.79 \n",
- " 1966.28 \n",
- " \n",
- " \n",
- " 459 \n",
- " 2022-11-18 \n",
- " 1971.79 \n",
- " 1976.33 \n",
- " 1966.06 \n",
- " 1967.03 \n",
- " \n",
- " \n",
- " 460 \n",
- " 2022-11-21 \n",
- " 1972.49 \n",
- " 1975.14 \n",
- " 1965.64 \n",
- " 1972.57 \n",
- " \n",
- " \n",
- " 461 \n",
- " 2022-11-22 \n",
- " 1983.10 \n",
- " 1998.61 \n",
- " 1982.72 \n",
- " 1994.75 \n",
- " \n",
- " \n",
- " 462 \n",
- " 2022-11-24 \n",
- " 2014.11 \n",
- " 2023.39 \n",
- " 2013.68 \n",
- " 2018.80 \n",
- " \n",
- " \n",
- "
\n",
- "
463 rows × 5 columns
\n",
- "
\n",
- "
\n",
- " \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " \n",
- "\n",
- " \n",
- "
\n",
- "
\n",
- " "
- ]
- },
- "metadata": {},
- "execution_count": 35
- }
- ]
+ "execution_count": null,
+ "outputs": []
},
{
"cell_type": "code",
@@ -9387,138 +1004,10 @@
"df_topix[df_topix.isnull().any(axis=1)]\n"
],
"metadata": {
- "colab": {
- "base_uri": "https://localhost:8080/",
- "height": 49
- },
- "outputId": "f08003c3-01c1-4b75-e114-70e2717a46cb",
"id": "gYr-AIci27X6"
},
- "execution_count": 36,
- "outputs": [
- {
- "output_type": "execute_result",
- "data": {
- "text/plain": [
- "Empty DataFrame\n",
- "Columns: [Date, Open, High, Low, Close]\n",
- "Index: []"
- ],
- "text/html": [
- "\n",
- " \n",
- "
\n",
- "
\n",
- "\n",
- "
\n",
- " \n",
- " \n",
- " \n",
- " Date \n",
- " Open \n",
- " High \n",
- " Low \n",
- " Close \n",
- " \n",
- " \n",
- " \n",
- " \n",
- "
\n",
- "
\n",
- "
\n",
- " \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " \n",
- " \n",
- "\n",
- " \n",
- "
\n",
- "
\n",
- " "
- ]
- },
- "metadata": {},
- "execution_count": 36
- }
- ]
+ "execution_count": null,
+ "outputs": []
},
{
"cell_type": "markdown",
@@ -9533,8 +1022,9 @@
"cell_type": "code",
"source": [
"# JPXの2021年からの株価を取得\n",
- "df_jpx = cli.get_prices_daily_quotes(code=8697, from_yyyymmdd=20210101, to_yyyymmdd=20221124)\n",
- "df_topix = cli.get_indices_topix(from_yyyymmdd=20210101, to_yyyymmdd=20221124)\n",
+ "d_now = datetime.now().strftime(\"%Y%m%d\")\n",
+ "df_jpx = cli.get_prices_daily_quotes(code=8697, from_yyyymmdd=20210101, to_yyyymmdd=d_now)\n",
+ "df_topix = cli.get_indices_topix(from_yyyymmdd=20210101, to_yyyymmdd=d_now)\n",
"\n",
"# グラフに第2軸を設定\n",
"fig = make_subplots(specs=[[{\"secondary_y\": True}]])\n",
@@ -9555,55 +1045,10 @@
"fig.show()\n"
],
"metadata": {
- "colab": {
- "base_uri": "https://localhost:8080/",
- "height": 542
- },
- "outputId": "cc632c8f-a697-42da-c439-3c158479b34f",
"id": "RxpZT1jA1RV1"
},
- "execution_count": 37,
- "outputs": [
- {
- "output_type": "display_data",
- "data": {
- "text/html": [
- "\n",
- " \n",
- "\n",
- " \n",
- "\n",
- ""
- ]
- },
- "metadata": {}
- }
- ]
+ "execution_count": null,
+ "outputs": []
},
{
"cell_type": "markdown",
@@ -9644,8 +1089,8 @@
{
"cell_type": "code",
"source": [
- "# 2022年初来の財務情報取得\n",
- "df_fins = cli.get_statements_range(start_dt=\"20220101\")\n",
+ "# 2023年初来の財務情報取得\n",
+ "df_fins = cli.get_statements_range(start_dt=\"20230101\")\n",
"\n",
"\n",
"# 財務情報データから取得したい項目(株式銘柄コード、期末発行済株式数)を定義\n",
@@ -9675,7 +1120,7 @@
"metadata": {
"id": "zBIP-oKfu3ya"
},
- "execution_count": 38,
+ "execution_count": null,
"outputs": []
},
{
@@ -9691,7 +1136,8 @@
"cell_type": "code",
"source": [
"# 昨日の全銘柄株価を取得\n",
- "df_prices = cli.get_prices_daily_quotes(date_yyyymmdd=20221124)\n",
+ "d_yesterday = (datetime.now() - timedelta(days=1)).strftime(format=\"%Y%m%d\")\n",
+ "df_prices = cli.get_prices_daily_quotes(date_yyyymmdd=d_yesterday)\n",
"\n",
"# 銘柄一覧を取得\n",
"df_info = cli.get_list()\n",
@@ -9721,7 +1167,7 @@
"metadata": {
"id": "nY2Zs7UK3ZdO"
},
- "execution_count": 39,
+ "execution_count": null,
"outputs": []
},
{
@@ -9736,8 +1182,9 @@
{
"cell_type": "code",
"source": [
- "# 9月末から10月末までの約1か月分の全銘柄の株価情報を取得\n",
- "df_1month_prices = cli.get_price_range(start_dt=\"20220930\", end_dt=\"20221031\") \n",
+ "# 3月の約1か月分の全銘柄の株価情報を取得\n",
+ "\n",
+ "df_1month_prices = cli.get_price_range(start_dt=\"20230228\", end_dt=\"20230331\") \n",
"\n",
"# 各業種の時価総額Top5のみの調整済み終値を取得\n",
"df_top5_1month_prices = df_1month_prices[df_1month_prices[\"Code\"].isin(\n",
@@ -9760,29 +1207,10 @@
"df_returns = pd.DataFrame(returns_list)"
],
"metadata": {
- "id": "fQ-QSXr3R8pb",
- "colab": {
- "base_uri": "https://localhost:8080/"
- },
- "outputId": "11208d8c-d404-41aa-c044-eeb0ef8d98b1"
+ "id": "fQ-QSXr3R8pb"
},
- "execution_count": 40,
- "outputs": [
- {
- "output_type": "stream",
- "name": "stderr",
- "text": [
- "/usr/local/lib/python3.7/dist-packages/ipykernel_launcher.py:11: SettingWithCopyWarning:\n",
- "\n",
- "\n",
- "A value is trying to be set on a copy of a slice from a DataFrame.\n",
- "Try using .loc[row_indexer,col_indexer] = value instead\n",
- "\n",
- "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n",
- "\n"
- ]
- }
- ]
+ "execution_count": null,
+ "outputs": []
},
{
"cell_type": "markdown",
@@ -9810,60 +1238,15 @@
"fig.show()\n"
],
"metadata": {
- "colab": {
- "base_uri": "https://localhost:8080/",
- "height": 0
- },
- "id": "RJt4Y7jtKFPg",
- "outputId": "525ebef3-1b06-4d13-bae5-9b5ab202e207"
+ "id": "RJt4Y7jtKFPg"
},
- "execution_count": 41,
- "outputs": [
- {
- "output_type": "display_data",
- "data": {
- "text/html": [
- "\n",
- " \n",
- "\n",
- " \n",
- "\n",
- ""
- ]
- },
- "metadata": {}
- }
- ]
+ "execution_count": null,
+ "outputs": []
},
{
"cell_type": "markdown",
"source": [
- "## 17業種でも作成(11/25追記) "
+ "## 17業種でも作成"
],
"metadata": {
"id": "MyvNuiZsMmG2"
@@ -9881,8 +1264,8 @@
{
"cell_type": "code",
"source": [
- "# 2022年初来の財務情報取得\n",
- "df_fins = cli.get_statements_range(start_dt=\"20220101\")\n",
+ "# 2023年初来の財務情報取得\n",
+ "df_fins = cli.get_statements_range(start_dt=\"20230101\")\n",
"\n",
"\n",
"# 財務情報データから取得したい項目(株式銘柄コード、期末発行済株式数)を定義\n",
@@ -9912,7 +1295,7 @@
"metadata": {
"id": "8ErokySZMTtU"
},
- "execution_count": 42,
+ "execution_count": null,
"outputs": []
},
{
@@ -9928,7 +1311,9 @@
"cell_type": "code",
"source": [
"# 昨日の全銘柄株価を取得\n",
- "df_prices = cli.get_prices_daily_quotes(date_yyyymmdd=20221124)\n",
+ "d_yesterday = (datetime.now() - timedelta(days=1)).strftime(format=\"%Y%m%d\")\n",
+ "df_prices = cli.get_prices_daily_quotes(date_yyyymmdd=d_yesterday)\n",
+ "\n",
"\n",
"# 銘柄一覧を取得\n",
"df_info = cli.get_list()\n",
@@ -9958,7 +1343,7 @@
"metadata": {
"id": "udsV1CxbMTtV"
},
- "execution_count": 43,
+ "execution_count": null,
"outputs": []
},
{
@@ -9974,7 +1359,7 @@
"cell_type": "code",
"source": [
"# 9月末から10月末までの約1か月分の全銘柄の株価情報を取得\n",
- "df_1month_prices = cli.get_price_range(start_dt=\"20220930\", end_dt=\"20221031\") \n",
+ "df_1month_prices = cli.get_price_range(start_dt=\"20230228\", end_dt=\"20230331\") \n",
"\n",
"# 各業種の時価総額Top5のみの調整済み終値を取得\n",
"df_top5_1month_prices = df_1month_prices[df_1month_prices[\"Code\"].isin(\n",
@@ -9997,29 +1382,10 @@
"df_returns = pd.DataFrame(returns_list)"
],
"metadata": {
- "colab": {
- "base_uri": "https://localhost:8080/"
- },
- "outputId": "1f6f49b4-76c2-47c4-8ede-09aa260571d4",
"id": "GDfWncTWMTtV"
},
- "execution_count": 44,
- "outputs": [
- {
- "output_type": "stream",
- "name": "stderr",
- "text": [
- "/usr/local/lib/python3.7/dist-packages/ipykernel_launcher.py:11: SettingWithCopyWarning:\n",
- "\n",
- "\n",
- "A value is trying to be set on a copy of a slice from a DataFrame.\n",
- "Try using .loc[row_indexer,col_indexer] = value instead\n",
- "\n",
- "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n",
- "\n"
- ]
- }
- ]
+ "execution_count": null,
+ "outputs": []
},
{
"cell_type": "markdown",
@@ -10047,140 +1413,10 @@
"fig.show()\n"
],
"metadata": {
- "colab": {
- "base_uri": "https://localhost:8080/",
- "height": 0
- },
- "outputId": "5928b12e-47a7-49eb-efb7-afe61282ac47",
"id": "FrLes332MTtW"
},
- "execution_count": 45,
- "outputs": [
- {
- "output_type": "display_data",
- "data": {
- "text/html": [
- "\n",
- " \n",
- "\n",
- " \n",
- "\n",
- ""
- ]
- },
- "metadata": {}
- }
- ]
- },
- {
- "cell_type": "markdown",
- "source": [
- "## TOPIX指数API"
- ],
- "metadata": {
- "id": "CE2z-Oxp0iYT"
- }
- },
- {
- "cell_type": "code",
- "source": [
- "# JPXの2021年からの株価を取得\n",
- "df_jpx = cli.get_prices_daily_quotes(code=8697, from_yyyymmdd=20210101, to_yyyymmdd=20221124)\n",
- "df_topix = cli.get_indices_topix(from_yyyymmdd=20210101, to_yyyymmdd=20221124)\n",
- "\n",
- "# グラフに第2軸を設定\n",
- "fig = make_subplots(specs=[[{\"secondary_y\": True}]])\n",
- "\n",
- "# ローソク足を描画\n",
- "fig.add_trace(\n",
- " go.Candlestick(x=df_jpx.Date,\n",
- " open=df_jpx.AdjustmentOpen,\n",
- " high=df_jpx.AdjustmentHigh,\n",
- " low=df_jpx.AdjustmentLow,\n",
- " close=df_jpx.AdjustmentClose,\n",
- " name=\"OHLC\"))\n",
- "\n",
- "# 取引高を第2軸に設定\n",
- "fig.add_trace(go.Scatter(x=df_topix.Date, y=df_topix.Close, name=\"TOPIX指数終値\", line=dict(color=\"#51848E\")),\n",
- " secondary_y=True)\n",
- "fig.update_layout(title_text=\"JPX(8697)のローソク足及びTOPIX指数\")\n",
- "fig.show()\n"
- ],
- "metadata": {
- "colab": {
- "base_uri": "https://localhost:8080/",
- "height": 0
- },
- "id": "sMjBHJnPNmAZ",
- "outputId": "1549f8fc-2dea-46a8-8865-42b489f7790e"
- },
- "execution_count": 46,
- "outputs": [
- {
- "output_type": "display_data",
- "data": {
- "text/html": [
- "\n",
- " \n",
- "\n",
- " \n",
- "\n",
- ""
- ]
- },
- "metadata": {}
- }
- ]
+ "execution_count": null,
+ "outputs": []
},
{
"cell_type": "markdown",
@@ -10188,7 +1424,7 @@
"# ご意見等\n",
"その他、こんなデータが欲しいというご要望や、こんなデータありますか?といった質問もどしどし受け付けております!!\n",
"\n",
- "マケデコdiscordの`#j-quants-api`チャンネルに送ってください!! \n",
+ "[マケデコdiscord](https://discord.gg/xg6P5RXwaa)の`#j-quants-api`チャンネルに送ってください!! \n",
"よろしくお願いいたします。"
],
"metadata": {
@@ -10201,7 +1437,7 @@
"metadata": {
"id": "rTg-yl_3NTeH"
},
- "execution_count": 46,
+ "execution_count": null,
"outputs": []
}
]