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", - " \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", - " \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", - " \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", - "
DateCodeCompanyNameSector17CodeSector17CodeNameSector33CodeSector33CodeNameScaleCategoryMarketCodeMarketCodeName
02022-11-2513010極洋1食品0050水産・農林業TOPIX Small 2111プライム
12022-11-2513050ダイワ上場投信−トピックス99その他9999その他-109その他
22022-11-2513060NEXTFUNDSTOPIX連動型上場投信99その他9999その他-109その他
32022-11-2513080上場インデックスファンドTOPIX99その他9999その他-109その他
42022-11-2513090NEXTFUNDSChinaAMC・中国株式・上証50連動型上場投信99その他9999その他-109その他
.................................
42212022-11-2599930ヤマザワ14小売6100小売業TOPIX Small 2112スタンダード
42222022-11-2599940やまや14小売6100小売業TOPIX Small 2112スタンダード
42232022-11-2599950グローセル13商社・卸売6050卸売業TOPIX Small 2111プライム
42242022-11-2599960サトー商会13商社・卸売6050卸売業-112スタンダード
42252022-11-2599970ベルーナ14小売6100小売業TOPIX Small 1111プライム
\n", - "

4226 rows × 10 columns

\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", - " \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", - " \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", - " \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", - "
DateCodeCompanyNameSector17CodeSector17CodeNameSector33CodeSector33CodeNameScaleCategoryMarketCodeMarketCodeName
02022-11-2513010極洋1食品0050水産・農林業TOPIX Small 2111プライム
12022-11-2513050ダイワ上場投信−トピックス99その他9999その他-109その他
22022-11-2513060NEXTFUNDSTOPIX連動型上場投信99その他9999その他-109その他
32022-11-2513080上場インデックスファンドTOPIX99その他9999その他-109その他
42022-11-2513090NEXTFUNDSChinaAMC・中国株式・上証50連動型上場投信99その他9999その他-109その他
.................................
42212022-11-2599930ヤマザワ14小売6100小売業TOPIX Small 2112スタンダード
42222022-11-2599940やまや14小売6100小売業TOPIX Small 2112スタンダード
42232022-11-2599950グローセル13商社・卸売6050卸売業TOPIX Small 2111プライム
42242022-11-2599960サトー商会13商社・卸売6050卸売業-112スタンダード
42252022-11-2599970ベルーナ14小売6100小売業TOPIX Small 1111プライム
\n", - "

4226 rows × 10 columns

\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", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - "
DateCodeCompanyNameSector17CodeSector17CodeNameSector33CodeSector33CodeNameScaleCategoryMarketCodeMarketCodeName
\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", - " \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", - "
DateCodeCompanyNameSector17CodeSector17CodeNameSector33CodeSector33CodeNameScaleCategoryMarketCodeMarketCodeName
6132022-11-2525930伊藤園1食品3050食料品TOPIX Mid400111プライム
6142022-11-2525935株式会社伊藤園第1種1食品3050食料品-111プライム
\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", - " \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", - " \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", - " \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", - "
DateCodeCompanyNameSector17CodeSector17CodeNameSector33CodeSector33CodeNameScaleCategoryMarketCodeMarketCodeName
12022-11-2513050ダイワ上場投信−トピックス99その他9999その他-109その他
22022-11-2513060NEXTFUNDSTOPIX連動型上場投信99その他9999その他-109その他
32022-11-2513080上場インデックスファンドTOPIX99その他9999その他-109その他
42022-11-2513090NEXTFUNDSChinaAMC・中国株式・上証50連動型上場投信99その他9999その他-109その他
52022-11-2513110NEXTFUNDSTOPIXCore30連動型上場投信99その他9999その他-109その他
.................................
39122022-11-2592820いちごグリーンインフラ投資法人99その他9999その他-109その他
39132022-11-2592840カナディアン・ソーラー・インフラ投資法人99その他9999その他-109その他
39142022-11-2592850東京インフラ・エネルギー投資法人99その他9999その他-109その他
39152022-11-2592860エネクス・インフラ投資法人99その他9999その他-109その他
39162022-11-2592870ジャパン・インフラファンド投資法人99その他9999その他-109その他
\n", - "

374 rows × 10 columns

\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", - "\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", - "\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", - "\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", - "\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", - "\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", - " \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", - " \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", - " \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", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - "
CodeDateOpenHighLowCloseVolumeTurnoverValueAdjustmentFactorAdjustmentOpenAdjustmentHighAdjustmentLowAdjustmentCloseAdjustmentVolume
0869702017-01-041690.01713.01681.01706.01999000.03.401429e+091.01690.01713.01681.01706.01999000.0
1869702017-01-051703.01716.01696.01712.02137100.03.653718e+091.01703.01716.01696.01712.02137100.0
2869702017-01-061694.01698.01688.01691.01678400.02.841347e+091.01694.01698.01688.01691.01678400.0
3869702017-01-101682.01688.01662.01664.01883600.03.147536e+091.01682.01688.01662.01664.01883600.0
4869702017-01-111700.01702.01682.01687.01786100.03.019238e+091.01700.01702.01682.01687.01786100.0
.............................................
1434869702022-11-171969.01985.51969.01972.01035900.02.044283e+091.01969.01985.51969.01972.01035900.0
1435869702022-11-181994.51994.51965.51967.01257700.02.480479e+091.01994.51994.51965.51967.01257700.0
1436869702022-11-211967.01973.51949.01957.0918900.01.798190e+091.01967.01973.51949.01957.0918900.0
1437869702022-11-221961.51981.01961.01971.51152300.02.272961e+091.01961.51981.01961.01971.51152300.0
1438869702022-11-241996.52021.01994.02018.51314100.02.645815e+091.01996.52021.01994.02018.51314100.0
\n", - "

1439 rows × 14 columns

\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", - " \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", - "
CodeDateOpenHighLowCloseVolumeTurnoverValueAdjustmentFactorAdjustmentOpenAdjustmentHighAdjustmentLowAdjustmentCloseAdjustmentVolume
913869702020-10-01NaNNaNNaNNaNNaNNaN1.0NaNNaNNaNNaNNaN
\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", - " \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", - " \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", - " \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", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - "
CodeDateOpenHighLowCloseVolumeTurnoverValueAdjustmentFactorAdjustmentOpenAdjustmentHighAdjustmentLowAdjustmentCloseAdjustmentVolume
0130102022-08-013630.03650.03615.03650.010600.03.860450e+071.03630.03650.03615.03650.010600.0
1130502022-08-012024.52043.02019.52041.069750.01.421875e+081.02024.52043.02019.52041.069750.0
2130602022-08-012001.02020.51996.52019.01645480.03.311800e+091.02001.02020.51996.52019.01645480.0
3130802022-08-011979.51997.51972.51996.0240200.04.784298e+081.01979.51997.51972.51996.0240200.0
4130902022-08-0142840.043100.042210.042780.087.03.716680e+061.042840.043100.042210.042780.087.0
.............................................
4191999302022-08-011420.01422.01418.01420.010800.01.532970e+071.01420.01422.01418.01420.010800.0
4192999402022-08-012624.02662.02624.02662.05000.01.322050e+071.02624.02662.02624.02662.05000.0
4193999502022-08-01425.0425.0410.0410.0129300.05.362010e+071.0425.0425.0410.0410.0129300.0
4194999602022-08-011240.01241.01235.01241.03300.04.091000e+061.01240.01241.01235.01241.03300.0
4195999702022-08-01730.0762.0720.0753.0566300.04.199512e+081.0730.0762.0720.0753.0566300.0
\n", - "

4196 rows × 14 columns

\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", - " \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", - " \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", - " \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", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - "
CodeDateOpenHighLowCloseVolumeTurnoverValueAdjustmentFactorAdjustmentOpenAdjustmentHighAdjustmentLowAdjustmentCloseAdjustmentVolume
8131902022-08-01NaNNaNNaNNaNNaNNaN1.0NaNNaNNaNNaNNaN
12132402022-08-01NaNNaNNaNNaNNaNNaN1.0NaNNaNNaNNaNNaN
46138702022-08-01NaNNaNNaNNaNNaNNaN1.0NaNNaNNaNNaNNaN
54139702022-08-01NaNNaNNaNNaNNaNNaN1.0NaNNaNNaNNaNNaN
68143202022-08-01NaNNaNNaNNaNNaNNaN1.0NaNNaNNaNNaNNaN
.............................................
4064972002022-08-01NaNNaNNaNNaNNaNNaN1.0NaNNaNNaNNaNNaN
4095978002022-08-01NaNNaNNaNNaNNaNNaN1.0NaNNaNNaNNaNNaN
4129985702022-08-01NaNNaNNaNNaNNaNNaN1.0NaNNaNNaNNaNNaN
4173996702022-08-01NaNNaNNaNNaNNaNNaN1.0NaNNaNNaNNaNNaN
4178997602022-08-01NaNNaNNaNNaNNaNNaN1.0NaNNaNNaNNaNNaN
\n", - "

129 rows × 14 columns

\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", - " \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", - " \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", - " \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", - " \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", - " \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", - " \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", - " \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", - "
CodeDateOpenHighLowCloseVolumeTurnoverValueAdjustmentFactorAdjustmentOpenAdjustmentHighAdjustmentLowAdjustmentCloseAdjustmentVolume
0869702022-08-012115.52144.02097.02143.5945400.02.016768e+091.02115.52144.02097.02143.5945400.0
1869702022-08-022132.02136.02099.02102.5857200.01.807583e+091.02132.02136.02099.02102.5857200.0
2869702022-08-032125.02143.52121.52129.0941200.02.004944e+091.02125.02143.52121.52129.0941200.0
3869702022-08-042142.02142.52125.02138.0691500.01.477278e+091.02142.02142.52125.02138.0691500.0
4869702022-08-052150.02171.02146.02164.5775400.01.676780e+091.02150.02171.02146.02164.5775400.0
5869702022-08-082166.02174.02155.52171.5712700.01.544867e+091.02166.02174.02155.52171.5712700.0
6869702022-08-092175.52181.52147.52155.0757300.01.636470e+091.02175.52181.52147.52155.0757300.0
7869702022-08-102161.52169.52136.52147.0676800.01.453722e+091.02161.52169.52136.52147.0676800.0
8869702022-08-122208.52209.02162.52172.01649500.03.602564e+091.02208.52209.02162.52172.01649500.0
9869702022-08-152173.02193.52164.02191.5645700.01.410109e+091.02173.02193.52164.02191.5645700.0
10869702022-08-162197.02200.52178.02182.0684500.01.495720e+091.02197.02200.52178.02182.0684500.0
11869702022-08-172198.02226.52195.02223.5994900.02.207119e+091.02198.02226.52195.02223.5994900.0
12869702022-08-182220.52224.52191.52200.0816400.01.798841e+091.02220.52224.52191.52200.0816400.0
13869702022-08-192206.02206.52169.02171.5828800.01.805492e+091.02206.02206.52169.02171.5828800.0
14869702022-08-222154.02165.52146.02161.5577800.01.247047e+091.02154.02165.52146.02161.5577800.0
15869702022-08-232142.52155.52125.52146.0725600.01.555905e+091.02142.52155.52125.52146.0725600.0
16869702022-08-242149.02150.02134.02144.0620500.01.330035e+091.02149.02150.02134.02144.0620500.0
17869702022-08-252167.02181.02157.52170.0797000.01.730139e+091.02167.02181.02157.52170.0797000.0
18869702022-08-262189.52191.02161.52163.5536900.01.165411e+091.02189.52191.02161.52163.5536900.0
19869702022-08-292118.02120.02071.02072.01540500.03.211936e+091.02118.02120.02071.02072.01540500.0
20869702022-08-302092.52115.02084.02107.5914000.01.922998e+091.02092.52115.02084.02107.5914000.0
21869702022-08-312081.52095.02077.02084.51166200.02.431587e+091.02081.52095.02077.02084.51166200.0
22869702022-09-012052.02064.02033.02059.01192300.02.448594e+091.02052.02064.02033.02059.01192300.0
\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", - " \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", - " \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", - " \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", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - "
CodeDateOpenHighLowCloseVolumeTurnoverValueAdjustmentFactorAdjustmentOpenAdjustmentHighAdjustmentLowAdjustmentCloseAdjustmentVolume
0130102022-08-013630.03650.03615.03650.010600.038604500.01.03630.03650.03615.03650.010600.0
0130102022-08-023650.03650.03610.03615.09200.033328500.01.03650.03650.03610.03615.09200.0
0130102022-08-033600.03600.03570.03575.010600.037995500.01.03600.03600.03570.03575.010600.0
0130102022-08-043600.03600.03505.03525.014500.051253500.01.03600.03600.03505.03525.014500.0
0130102022-08-053510.03750.03510.03675.066900.0245070500.01.03510.03750.03510.03675.066900.0
.............................................
4194999702022-08-25745.0752.0738.0748.0163600.0122059300.01.0745.0752.0738.0748.0163600.0
4194999702022-08-26749.0756.0749.0752.0161100.0121237800.01.0749.0756.0749.0752.0161100.0
4193999702022-08-29737.0745.0735.0742.0134700.099769600.01.0737.0745.0735.0742.0134700.0
4191999702022-08-30747.0751.0743.0750.0134600.0100634800.01.0747.0751.0743.0750.0134600.0
4191999702022-08-31742.0746.0735.0740.0204700.0151454400.01.0742.0746.0735.0740.0204700.0
\n", - "

92324 rows × 14 columns

\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", - "\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", - " \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", - " \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", - " \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", - " \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", - " \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", - " \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", - " \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", - " \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", - " \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", - " \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", - " \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", - " \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", - " \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", - " \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", - " \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", - " \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", - " \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", - " \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", - " \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", - " \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", - " \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", - " \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", - " \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", - " \n", - "
DisclosureNumberDisclosedDateApplyingOfSpecificAccountingOfTheQuarterlyFinancialStatementsAverageNumberOfSharesBookValuePerShareChangesBasedOnRevisionsOfAccountingStandardChangesInAccountingEstimatesChangesOtherThanOnesBasedOnRevisionsOfAccountingStandardCurrentFiscalYearEndDateCurrentFiscalYearStartDateCurrentPeriodEndDateDisclosedTimeDisclosedUnixTimeEarningsPerShareEquityEquityToAssetRatioForecastDividendPerShare1stQuarterForecastDividendPerShare2ndQuarterForecastDividendPerShare3rdQuarterForecastDividendPerShareAnnualForecastDividendPerShareFiscalYearEndForecastEarningsPerShareForecastNetSalesForecastOperatingProfitForecastOrdinaryProfitForecastProfitLocalCodeMaterialChangesInSubsidiariesNetSalesNumberOfIssuedAndOutstandingSharesAtTheEndOfFiscalYearIncludingTreasuryStockNumberOfTreasuryStockAtTheEndOfFiscalYearOperatingProfitOrdinaryProfitProfitResultDividendPerShare1stQuarterResultDividendPerShare2ndQuarterResultDividendPerShare3rdQuarterResultDividendPerShareAnnualResultDividendPerShareFiscalYearEndRetrospectiveRestatementTotalAssetsTypeOfCurrentPeriodTypeOfDocument
0201701274834652017-01-30547924549falsefalsefalse2017-03-312016-04-012016-12-3112:00:001485745200.058.12602970000000.00642.021.070.3210600000000054000000000555000000003850000000086970false80663000000549069100275405244814000000457830000003183200000021.0404506770000003Q3QFinancialStatements_Consolidated_IFRS
1201703214241492017-03-222017-03-312016-04-012017-03-3114:00:001490158800.047.026.076.3910700000000059000000000600000000004180000000086970FYForecastRevision
2201704274536862017-04-28547051034205.5falsefalsefalse2017-03-312016-04-012017-03-3112:00:001493348400.077.02637700000000.00624.048.024.078.6411200000000060000000000615000000004250000000086970false107885000000549069100863605259377000000606040000004212400000021.047.026.041288932000000FYFYFinancialStatements_Consolidated_IFRS
3201707274411402017-07-28537208664falsefalsefalse2018-03-312017-04-012017-06-3012:00:001501210800.020.242524250000000.00724.048.024.079.2711200000000060000000000615000000004250000000086970false2787600000054906910013303873164400000001663000000010874000000378784870000001Q1QFinancialStatements_Consolidated_IFRS
4201710274013902017-10-30536483009falsefalsefalse2018-03-312017-04-012017-09-3012:00:001509332400.042.32649470000000.00648.024.079.2711000000000060000000000615000000004250000000086970false557620000005490691001330380732808000000335540000002269200000024.0425235040000002Q2QFinancialStatements_Consolidated_IFRS
5201801304597662018-01-31536242907falsefalsefalse2018-03-312017-04-012017-12-3112:00:001517367600.069.362671770000000.00748.024.079.2711000000000060000000000615000000004250000000086970false878610000005490691001330375453090000000540420000003719500000024.0379872610000003Q3QFinancialStatements_Consolidated_IFRS
6201803224944882018-03-222018-03-312017-04-012018-03-3112:00:001521687600.057.033.093.2612000000000071000000000725000000005000000000086970FYForecastRevision
7201804264222692018-04-27536125158208.99falsefalsefalse2018-03-312017-04-012018-03-3112:00:001524798000.094.172797360000000.00727.054.027.089.5912300000000068000000000690000000004800000000086970false12071100000053635144858541671791000000729900000005048400000024.067.043.041316341000000FYFYFinancialStatements_Consolidated_IFRS
8201807274869432018-07-30535766032truefalsefalse2019-03-312018-04-012018-06-3012:00:001532919600.021.692680650000000.00727.054.027.089.5912300000000068000000000690000000004800000000086970false29562000000536351448585416174130000001760900000011623000000358421300000001Q1QFinancialStatements_Consolidated_IFRS
9201810264237392018-10-29535725501truefalsefalse2019-03-312018-04-012018-09-3012:00:001540782000.044.652816570000000.00654.027.089.6112000000000068000000000690000000004800000000086970false5923100000053635144872121634355000000350980000002392000000027.0425447500000002Q2QFinancialStatements_Consolidated_IFRS
10201901284646362019-01-29535693629truefalsefalse2019-03-312018-04-012018-12-3112:00:001548730800.071.742810590000000.00554.027.089.6112000000000068000000000690000000004800000000086970false9202000000053635144872121654302000000552850000003843000000027.0550092030000003Q3QFinancialStatements_Consolidated_IFRS
11201904254119562019-04-26535678846220.37truefalsefalse2019-03-312018-04-012019-03-3112:00:001556247600.091.582914500000000.00526.052.026.085.8812200000000066000000000665000000004600000000086970false12113400000053635144871862069535000000707860000004905700000027.070.043.054069405000000FYFYFinancialStatements_Consolidated_IFRS
12201907264768802019-07-30535522061truefalsefalse2020-03-312019-04-012019-06-3012:00:001564455600.020.02799600000000.00526.052.026.085.9112200000000066000000000665000000004600000000086970false29069000000536351448911324162460000001640200000010711000000564223960000001Q1QFinancialStatements_Consolidated_IFRS
13201909204998812019-09-252020-03-312019-04-012020-03-3108:30:001569367800.024.048.024.078.4411700000000060000000000605000000004200000000086970FYForecastRevision
14201910294146162019-10-30535480869truetruefalse2020-03-312019-04-012019-09-3012:00:001572404400.040.292920190000000.00448.024.078.4411700000000060000000000605000000004200000000086970false5793600000053635144891132431870000000320110000002157300000024.0684101430000002Q2QFinancialStatements_Consolidated_IFRS
15202001294530732020-01-30535467238truetruefalse2020-03-312019-04-012019-12-3112:00:001580353200.062.222925660000000.00548.024.078.4411700000000060000000000605000000004200000000086970true8743300000053635144891132448176000000485860000003331700000024.0566711980000003Q3QFinancialStatements_Consolidated_IFRS
16202003194819302020-03-232020-03-312019-04-012020-03-3115:30:001584945000.054.030.088.7112300000000067500000000680000000004750000000086970FYForecastRevision
17202004294022262020-04-30535464274231.75truetruefalse2020-03-312019-04-012020-03-3112:00:001588215600.088.913053750000000.00424.048.024.079.3712150000000062000000000621000000004250000000086970true12368800000053635144890447668533000000690950000004760900000024.054.030.067286302000000FYFYFinancialStatements_Consolidated_IFRS
18202007284683522020-07-29535342754falsefalsefalse2021-03-312020-04-012020-06-3012:00:001595991600.022.573010730000000.00524.048.024.079.412150000000062000000000621000000004250000000086970false326660000005363514481075955183650000001841400000012082000000608270680000001Q1QFinancialStatements_Consolidated_IFRS
19202010274099442020-10-28535311832falsefalsefalse2021-03-312020-04-012020-09-3012:00:001603854000.044.443134630000000.00552.026.085.012600000000065500000000656000000004550000000086970false63834000000536351448106925535191000000352250000002378700000026.0605455590000002Q2QFinancialStatements_Consolidated_IFRS
20202101274501612021-01-28535301916falsefalsefalse2021-03-312020-04-012020-12-3112:00:001611802800.069.83137550000000.00552.026.085.012600000000065500000000656000000004550000000086970false97273000000536351448106925554365000000544790000003736100000026.0593931000000003Q3QFinancialStatements_Consolidated_IFRS
21202103194814542021-03-222021-03-312020-04-012021-03-3112:00:001616382000.068.042.096.2113300000000074000000000741000000005150000000086970FYForecastRevision
22202104274020532021-04-28535304490252.81falsefalsefalse2021-03-312020-04-012021-03-3112:00:001619578800.096.03287690000000.00526.052.026.085.013000000000066000000000660000000004550000000086970false133343000000536351448103440074565000000747320000005138900000026.068.042.060075678000000FYFYFinancialStatements_Consolidated_IFRS
23202107274720462021-07-28533875558falsefalsefalse2022-03-312021-04-012021-06-3012:00:001627441200.023.023082890000000.00526.052.026.085.5513000000000066000000000660000000004550000000086970false325030000005363514485170427184590000001847100000012291000000613012180000001Q1QFinancialStatements_Consolidated_IFRS
24202110264168852021-10-27531421385falsefalsefalse2022-03-312021-04-012021-09-3012:00:001635303600.046.233112950000000.00553.027.086.8813100000000067500000000675000000004600000000086970false65506000000536351448882272736051000000360440000002456400000026.0595830640000002Q2QFinancialStatements_Consolidated_IFRS
25202201265730262022-01-27530119112falsefalsefalse2022-03-312021-04-012021-12-3112:00:001643252400.071.713113810000000.00553.027.086.8813100000000067500000000675000000004600000000086970false100586000000536351448882272755967000000559360000003801300000026.0620765190000003Q3QFinancialStatements_Consolidated_IFRS
26202203185080902022-03-222022-03-312021-04-012022-03-3112:00:001647918000.072.046.094.4313550000000073500000000735000000005000000000086970FYForecastRevision
27202204255270542022-04-26529487172230.88falsefalsefalse2022-03-312021-04-012022-03-3112:00:001650942000.094.353238520000000.00426.052.026.085.313250000000065500000000655000000004500000000086970false135432000000528578441103778273473000000734290000004995500000026.072.046.071463434000000FYFYFinancialStatements_Consolidated_IFRS
28202207265045832022-07-27527204054falsefalsefalse2023-03-312022-04-012022-06-3012:00:001658890800.022.933100980000000.00426.052.026.085.4213250000000065500000000655000000004500000000086970false335760000005285784411938843177770000001779000000012089000000760481800000001Q1QFinancialStatements_Consolidated_IFRS
29202210265499692022-10-27526953869falsetruefalse2023-03-312022-04-012022-09-3012:00:001666839600.044.013215680000000.00452.026.085.4213250000000065500000000655000000004500000000086970false66486000000528578441186104334127000000341220000002318900000026.0784653700000002Q2QFinancialStatements_Consolidated_IFRS
\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", - " \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", - "
DisclosureNumberDisclosedDateApplyingOfSpecificAccountingOfTheQuarterlyFinancialStatementsAverageNumberOfSharesBookValuePerShareChangesBasedOnRevisionsOfAccountingStandardChangesInAccountingEstimatesChangesOtherThanOnesBasedOnRevisionsOfAccountingStandardCurrentFiscalYearEndDateCurrentFiscalYearStartDateCurrentPeriodEndDateDisclosedTimeDisclosedUnixTimeEarningsPerShareEquityEquityToAssetRatioForecastDividendPerShare1stQuarterForecastDividendPerShare2ndQuarterForecastDividendPerShare3rdQuarterForecastDividendPerShareAnnualForecastDividendPerShareFiscalYearEndForecastEarningsPerShareForecastNetSalesForecastOperatingProfitForecastOrdinaryProfitForecastProfitLocalCodeMaterialChangesInSubsidiariesNetSalesNumberOfIssuedAndOutstandingSharesAtTheEndOfFiscalYearIncludingTreasuryStockNumberOfTreasuryStockAtTheEndOfFiscalYearOperatingProfitOrdinaryProfitProfitResultDividendPerShare1stQuarterResultDividendPerShare2ndQuarterResultDividendPerShare3rdQuarterResultDividendPerShareAnnualResultDividendPerShareFiscalYearEndRetrospectiveRestatementTotalAssetsTypeOfCurrentPeriodTypeOfDocument
\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", - "\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", - " \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", - " \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", - " \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", - " \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", - " \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", - " \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", - " \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", - " \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", - " \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", - " \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", - " \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", - " \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", - "
SectionPublishedDateStartDateEndDateProprietarySalesProprietaryPurchasesProprietaryTotalProprietaryBalanceBrokerageSalesBrokeragePurchasesBrokerageTotalBrokerageBalanceTotalSalesTotalPurchasesTotalTotalTotalBalanceIndividualsSalesIndividualsPurchasesIndividualsTotalIndividualsBalanceForeignersSalesForeignersPurchasesForeignersTotalForeignersBalanceSecuritiesCosSalesSecuritiesCosPurchasesSecuritiesCosTotalSecuritiesCosBalanceInvestmentTrustsSalesInvestmentTrustsPurchasesInvestmentTrustsTotalInvestmentTrustsBalanceBusinessCosSalesBusinessCosPurchasesBusinessCosTotalBusinessCosBalanceOtherCosSalesOtherCosPurchasesOtherCosTotalOtherCosBalanceInsuranceCosSalesInsuranceCosPurchasesInsuranceCosTotalInsuranceCosBalanceCityBKsRegionalBKsEtcSalesCityBKsRegionalBKsEtcPurchasesCityBKsRegionalBKsEtcTotalCityBKsRegionalBKsEtcBalanceTrustBanksSalesTrustBanksPurchasesTrustBanksTotalTrustBanksBalanceOtherFinancialInstitutionsSalesOtherFinancialInstitutionsPurchasesOtherFinancialInstitutionsTotalOtherFinancialInstitutionsBalance
3TSE1st2017-01-132017-01-042017-01-061.311271e+091.453327e+092.764598e+09142055504.07.165529e+097.030020e+091.419555e+10-135509151.08.476800e+098.483346e+091.696015e+106546353.01.401712e+091.161801e+092.563513e+09-239910460.05.094892e+095.317152e+091.041204e+10222260039.076381455.061700100.0138081555.0-14681355.0168705109.0124389642.0293094751.0-44315467.071217959.063526641.0134744600.0-7691318.010745152.015687836.026432988.04942684.015926202.09831555.025757757.0-6094647.010606789.08843871.019450660.0-1762918.0292932297.0245322795.0538255092.0-47609502.022410692.021764485.044175177.0-646207.0
2TSE2nd2017-01-132017-01-042017-01-061.309361e+076.535935e+061.962954e+07-6557672.02.092613e+082.152348e+084.244960e+085973519.02.223549e+082.217707e+084.441256e+08-584153.01.224825e+081.239568e+082.464393e+081474255.07.623919e+078.047202e+071.567112e+084232828.06051426.05778242.011829668.0-273184.0600795.0694595.01295390.093800.02139840.01980229.04120069.0-159611.0314555.0494071.0808626.0179516.019636.012986.032622.0-6650.036866.02301.039167.0-34565.01328241.01807118.03135359.0478877.048202.036455.084657.0-11747.0
1TSEJASDAQ2017-01-132017-01-042017-01-064.949104e+064.193588e+069.142692e+06-755516.01.416962e+081.422985e+082.839947e+08602320.01.466453e+081.464921e+082.931374e+08-153196.01.000472e+089.806762e+071.981148e+08-1979577.03.205425e+073.438530e+076.643955e+072331056.04653575.04334909.08988484.0-318666.01099405.01336156.02435561.0236751.01437706.01453605.02891311.015899.0244023.0342691.0586714.098668.014484.0318.014802.0-14166.051072.02026.053098.0-49046.02077054.02271613.04348667.0194559.017444.0104286.0121730.086842.0
4TSEMothers2017-01-132017-01-042017-01-061.110837e+078.629083e+061.973745e+07-2479283.03.014538e+083.042051e+086.056589e+082751341.03.125621e+083.128342e+086.253963e+08272058.02.042972e+082.023668e+084.066639e+08-1930418.08.185699e+078.562572e+071.674827e+083768728.07397443.06906340.014303783.0-491103.0805816.01837203.02643019.01031387.03524194.03405887.06930081.0-118307.0870179.0489709.01359888.0-380470.06691.04024.010715.0-2667.010205.036575.046780.026370.02681157.03526373.06207530.0845216.03918.06523.010441.02605.0
0TokyoNagoya2017-01-132017-01-042017-01-061.340438e+091.472728e+092.813166e+09132290383.07.819145e+097.692945e+091.551209e+10-126199641.09.159583e+099.165674e+091.832526e+106090742.01.829215e+091.586814e+093.416028e+09-242401144.05.285399e+095.518022e+091.080342e+10232623007.094500941.078768114.0173269055.0-15732827.0171266407.0128280714.0299547121.0-42985693.078352044.070374877.0148726921.0-7977167.012185795.017106799.029292594.04921004.015968397.09848883.025817280.0-6119514.010704934.08884774.019589708.0-1820160.0299072437.0252932398.0552004835.0-46140039.022480257.021913149.044393406.0-567108.0
...........................................................................................................................................................................
1487TokyoNagoya2022-11-102022-10-312022-11-042.394993e+091.815105e+094.210098e+09-579888234.01.389875e+101.449049e+102.838924e+10591739148.01.629374e+101.630559e+103.259934e+1011850914.03.337061e+093.243882e+096.580942e+09-93179237.09.639261e+091.002970e+101.966896e+10390440537.080291538.069134983.0149426521.0-11156555.0236863365.0435161651.0672025016.0198298286.0160883346.0295370810.0456254156.0134487464.042639347.035285865.077925212.0-7353482.020049551.011065024.031114575.0-8984527.018370386.05541764.023912150.0-12828622.0350520957.0340672593.0691193550.0-9848364.012810168.024673816.037483984.011863648.0
1489TSEGrowth2022-11-172022-11-072022-11-112.440619e+072.995495e+075.436114e+075548767.06.583420e+086.568187e+081.315161e+09-1523309.06.827482e+086.867736e+081.369522e+094025458.03.727606e+083.610436e+087.338042e+08-11717044.02.629781e+082.751938e+085.381719e+0812215711.06859937.05906201.012766138.0-953736.04273678.02776043.07049721.0-1497635.05407869.05564685.010972554.0156816.02984059.02444143.05428202.0-539916.040008.027852.067860.0-12156.0747515.01169.0748684.0-746346.02247754.03793497.06041251.01545743.042466.067720.0110186.025254.0
1492TSEPrime2022-11-172022-11-072022-11-112.097301e+092.142499e+094.239801e+0945197679.01.724874e+101.722988e+103.447862e+10-18866011.01.934604e+101.937238e+103.871842e+1026331668.04.501096e+093.868148e+098.369244e+09-632947829.01.170302e+101.220612e+102.390914e+10503098487.0115412046.089890415.0205302461.0-25521631.0312658622.0291184841.0603843463.0-21473781.0219679792.0309936213.0529616005.090256421.047262400.043472505.090734905.0-3789895.022225795.04728776.026954571.0-17497019.031973572.010095671.042069243.0-21877901.0266792216.0372706535.0639498751.0105914319.028620129.033592947.062213076.04972818.0
1490TSEStandard2022-11-172022-11-072022-11-112.423198e+072.396334e+074.819532e+07-268640.04.298038e+084.310501e+088.608539e+081246283.04.540358e+084.550134e+089.090492e+08977643.01.973267e+081.914895e+083.888162e+08-5837230.02.113342e+082.170655e+084.283997e+085731260.04939779.04744117.09683896.0-195662.04140266.03507349.07647615.0-632917.06222512.08780618.015003130.02558106.0600436.0976584.01577020.0376148.0232060.080694.0312754.0-151366.0415255.033817.0449072.0-381438.04453611.04191706.08645317.0-261905.0138971.0180258.0319229.041287.0
1491TokyoNagoya2022-11-172022-11-072022-11-112.145961e+092.196438e+094.342399e+0950476776.01.833846e+101.831933e+103.665779e+10-19126070.02.048442e+102.051577e+104.100019e+1031350706.05.072556e+094.422149e+099.494705e+09-650406352.01.217741e+101.269839e+102.487580e+10520983571.0127235055.0100560677.0227795732.0-26674378.0321079737.0297468283.0618548020.0-23611454.0231391656.0324353192.0555744848.092961536.050855262.046907299.097762561.0-3947963.022499593.04837324.027336917.0-17662269.033137658.010130657.043268315.0-23007001.0273493720.0380693460.0654187180.0107199740.028802817.033841317.062644134.05038500.0
\n", - "

1493 rows × 56 columns

\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", - " \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", - "
SectionPublishedDateStartDateEndDateProprietarySalesProprietaryPurchasesProprietaryTotalProprietaryBalanceBrokerageSalesBrokeragePurchasesBrokerageTotalBrokerageBalanceTotalSalesTotalPurchasesTotalTotalTotalBalanceIndividualsSalesIndividualsPurchasesIndividualsTotalIndividualsBalanceForeignersSalesForeignersPurchasesForeignersTotalForeignersBalanceSecuritiesCosSalesSecuritiesCosPurchasesSecuritiesCosTotalSecuritiesCosBalanceInvestmentTrustsSalesInvestmentTrustsPurchasesInvestmentTrustsTotalInvestmentTrustsBalanceBusinessCosSalesBusinessCosPurchasesBusinessCosTotalBusinessCosBalanceOtherCosSalesOtherCosPurchasesOtherCosTotalOtherCosBalanceInsuranceCosSalesInsuranceCosPurchasesInsuranceCosTotalInsuranceCosBalanceCityBKsRegionalBKsEtcSalesCityBKsRegionalBKsEtcPurchasesCityBKsRegionalBKsEtcTotalCityBKsRegionalBKsEtcBalanceTrustBanksSalesTrustBanksPurchasesTrustBanksTotalTrustBanksBalanceOtherFinancialInstitutionsSalesOtherFinancialInstitutionsPurchasesOtherFinancialInstitutionsTotalOtherFinancialInstitutionsBalance
\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", - "\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", - "\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", - " \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", - " \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", - "
DateOpenHighLowClose
02021-01-041810.451811.681776.601794.59
12021-01-051788.631797.121784.801791.22
22021-01-061790.861802.981789.681796.18
32021-01-071816.261837.501816.261826.30
42021-01-081832.681854.941829.051854.94
..................
4582022-11-171962.791972.751962.791966.28
4592022-11-181971.791976.331966.061967.03
4602022-11-211972.491975.141965.641972.57
4612022-11-221983.101998.611982.721994.75
4622022-11-242014.112023.392013.682018.80
\n", - "

463 rows × 5 columns

\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", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - "
DateOpenHighLowClose
\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", - "\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", - "\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", - "\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", - "\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": [] } ]