{"id":16145,"date":"2021-08-03T02:33:56","date_gmt":"2021-08-02T18:33:56","guid":{"rendered":"https:\/\/www.tejwin.com\/?post_type=insight&#038;p=16145"},"modified":"2024-07-03T17:31:40","modified_gmt":"2024-07-03T09:31:40","slug":"obtain-financial-data","status":"publish","type":"insight","link":"https:\/\/www.tejwin.com\/en\/insight\/obtain-financial-data\/","title":{"rendered":"Obtain Financial Data"},"content":{"rendered":"\n<p>Demonstrate how to get data from TEJ API financial database<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter caption-align-center\"><img decoding=\"async\" src=\"https:\/\/www.tejwin.com\/wp-content\/uploads\/1_0okaoyYv-qIMXr00U.png\" alt=\"\"\/><figcaption class=\"wp-element-caption\">Photo Creds:&nbsp;<a href=\"https:\/\/unsplash.com\/photos\/xoU52jUVUXA\" rel=\"noreferrer noopener\" target=\"_blank\">Unsplash<\/a><\/figcaption><\/figure>\n\n\n\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_81 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<label for=\"ez-toc-cssicon-toggle-item-69f55bbed5739\" class=\"ez-toc-cssicon-toggle-label\"><span class=\"ez-toc-cssicon\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/label><input type=\"checkbox\"  id=\"ez-toc-cssicon-toggle-item-69f55bbed5739\"  aria-label=\"Toggle\" \/><nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/www.tejwin.com\/en\/insight\/obtain-financial-data\/#Preface\" >Preface<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/www.tejwin.com\/en\/insight\/obtain-financial-data\/#The_Editing_Environment_and_Modules_Required\" >The Editing Environment and Modules Required<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/www.tejwin.com\/en\/insight\/obtain-financial-data\/#The_Highlights_of_the_Article\" >The Highlights of the Article<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/www.tejwin.com\/en\/insight\/obtain-financial-data\/#Trial_Database_vs_Paid_Database\" >Trial Database vs. Paid Database<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/www.tejwin.com\/en\/insight\/obtain-financial-data\/#Paid_Database_Used\" >Paid Database Used<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/www.tejwin.com\/en\/insight\/obtain-financial-data\/#Case_1_Obtain_All_Financial_Data_for_a_Company\" >Case 1: Obtain All Financial Data for a Company<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/www.tejwin.com\/en\/insight\/obtain-financial-data\/#Case_2_Obtain_Specified_Financial_Data_for_Multiple_Companies\" >Case 2: Obtain Specified Financial Data for Multiple Companies<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/www.tejwin.com\/en\/insight\/obtain-financial-data\/#Basic_Financial_Data_Processing\" >Basic Financial Data Processing<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/www.tejwin.com\/en\/insight\/obtain-financial-data\/#Conclusion\" >Conclusion<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/www.tejwin.com\/en\/insight\/obtain-financial-data\/#Related_Link\" >Related Link<\/a><\/li><\/ul><\/nav><\/div>\n<h2 class=\"wp-block-heading\" id=\"932d\"><span class=\"ez-toc-section\" id=\"Preface\"><\/span><strong>Preface<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p id=\"d9b5\">Financial data is the information firms disclose each season, or financial indicators based on that information. Common financial data mainly comes from balance sheets, income statements or cash flow statements. Besides, TEJ API financial database also includes more comprehensive information such as&nbsp;<strong>financial ratios, related party transactions, inventory detail<\/strong>&nbsp;and so on. With the standardized data type TEJ offers, we can do financial analysis, stocks selection and empirical research in a more efficient way. Therefore, in this week, we\u2019re about to introduce how to get financial data and demonstrate the basic financial data processing.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"536b\"><span class=\"ez-toc-section\" id=\"The_Editing_Environment_and_Modules_Required\"><\/span><strong>The Editing Environment and Modules Required<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p id=\"c433\">We use Windows OS and Jupyter Notebook in this article<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">import tejapi\nimport pandas as pd\ntejapi.ApiConfig.api_key = \"Your Key\"\ntejapi.ApiConfig.ignoretz = True<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"1bfe\"><span class=\"ez-toc-section\" id=\"The_Highlights_of_the_Article\"><\/span><strong>The Highlights of the Article<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>The procedure of obtaining data under different conditions<\/li>\n\n\n\n<li>Common data processing methods<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"de90\"><span class=\"ez-toc-section\" id=\"Trial_Database_vs_Paid_Database\"><\/span><strong>Trial Database vs. Paid Database<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<figure class=\"wp-block-image aligncenter\"><img decoding=\"async\" src=\"https:\/\/www.tejwin.com\/wp-content\/uploads\/1dwYqzSTPLPjJmhV3fPD17A.png\" alt=\"\"\/><\/figure>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p id=\"5ff4\"><em>Note 1: For instance, if you want to get 2000 amounts of data from a trial database, it will automatically stop working as 1000 amounts of data obtained. There, we suggest to add&nbsp;<\/em><code><em>paginate = True<\/em><\/code><em>&nbsp;in each call to make sure the completeness of the data<\/em><\/p>\n\n\n\n<p id=\"1ffa\"><em>Note 2: The upper limitation of data amount for each\u00a0<\/em><code><em>tejapi.get()<\/em><\/code><em>\u00a0call. To handle relevant issue, please refer to the devil in details part of\u00a0<\/em><a href=\"https:\/\/medium.com\/tej-api-%E9%87%91%E8%9E%8D%E8%B3%87%E6%96%99%E5%88%86%E6%9E%90\/introduction-4-tej-rest-api-document-62604989797f\" class=\"ek-link\" target=\"_blank\" rel=\"noopener\"><em>\u3010Introduction(4)\u3011TEJ Rest API Document<\/em><\/a><em>. If the enormous data amounts are expected, we suggest to use\u00a0<\/em><code><em>for<\/em><\/code><em>\u00a0loop to continuously combine the outcome of each call<\/em><\/p>\n\n\n\n<p id=\"76f6\"><em>Note 3: Pivot function will make financial accounts more readable, and more convenient for data processing and analysis. We will provide a detailed introduction later on.<\/em><\/p>\n<\/blockquote>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"b916\"><span class=\"ez-toc-section\" id=\"Paid_Database_Used\"><\/span><strong>Paid Database Used<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/api.tej.com.tw\/columndoc.html?subId=61\" rel=\"noreferrer noopener\" target=\"_blank\">Financial accounts document<\/a>: The code of the database is \u2018TWN\/AIACC\u2019, and it covers IFRS financial accounts classification, code, name and units.<\/li>\n\n\n\n<li><a href=\"https:\/\/api.tej.com.tw\/columns.html?idCode=TWN%2FAIM1A\" rel=\"noreferrer noopener\" target=\"_blank\">IFRS consolidated cumulative reports of all industries<\/a>: The code of the database is \u2018TWN\/AIM1A\u2019, and it contains cumulative financial information of firms in all industries<\/li>\n<\/ul>\n\n\n\n<p id=\"295c\"><em>Note: For example, Q2 (single season) means the data calculated only in Q2 ; while Q2 ( cumulative season) indicates the data calculated from Q1 to Q2.<\/em><\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"500d\"><span class=\"ez-toc-section\" id=\"Case_1_Obtain_All_Financial_Data_for_a_Company\"><\/span><strong>Case 1: Obtain All Financial Data for a Company<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<pre class=\"wp-block-preformatted\">au_no_pivot = tejapi.get('TWN\/AIM1A',<br>                    coid = '2409',<br>                    paginate = True,<br>                    chinese_column_name = True)<\/pre>\n\n\n\n<p id=\"b508\">Take the financial information of AU Optronics Corporation ( 2409 ) for example<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter\"><img decoding=\"async\" src=\"https:\/\/www.tejwin.com\/wp-content\/uploads\/0dxV-DD24jS0n123V.png\" alt=\"\"\/><\/figure>\n\n\n\n<p id=\"fceb\">There are only four columns. The date column 03\/01, 06\/01, 09\/01 and 12\/01 signify Q1, Q2, Q3 and Q4 respectively. The financial accounts are presented in the form of codes. Overall, it\u2019s not intuitive and not easy to process. Therefore, we must use&nbsp;<code>pivot&nbsp;<\/code>function,&nbsp;<strong>exclusive for paid database users<\/strong>, to make financial accounts manifest themselves in independent columns<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">au_pivot = tejapi.get('TWN\/AIM1A',<br>                    coid = '2409',<br>                    paginate = True,<br>                    opts = {'pivot':True},<br>                    chinese_column_name = True)<\/pre>\n\n\n\n<p id=\"e8b7\">With the inclusion of&nbsp;<code>opts = {\u2018pivot\u2019:True}<\/code>, we can clearly see each account name and corresponding value<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter\"><img decoding=\"async\" src=\"https:\/\/www.tejwin.com\/wp-content\/uploads\/0LGs0caZNieANhTnq.png\" alt=\"\"\/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"10d8\"><span class=\"ez-toc-section\" id=\"Case_2_Obtain_Specified_Financial_Data_for_Multiple_Companies\"><\/span><strong>Case 2: Obtain Specified Financial Data for Multiple Companies<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<pre class=\"wp-block-preformatted\">panel = ['2409', '3481', '6116']<\/pre>\n\n\n\n<p id=\"a8a8\"><code>panel&nbsp;<\/code>list contains the codes of several firms. Here we select AU Optronics Corporation ( 2409 ), Innolux Corporation (3481) and Hannstar Display Corp. (6116)<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">finance = pd.DataFrame()<\/pre>\n\n\n\n<p id=\"085d\">For starters, we create an empty table for storing the data from each loop<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">for firm in panel:<br>    finance = finance.append(tejapi.get('TWN\/AIM1A',<br>                    coid = firm,<br>                    paginate = True,<br>                    opts = {'pivot':True},<br>                    chinese_column_name = True))<\/pre>\n\n\n\n<p id=\"68ec\">With the usage of&nbsp;<code>for&nbsp;<\/code>loop and&nbsp;<code>append()&nbsp;<\/code>to pile up the data in&nbsp;<code>finance&nbsp;<\/code>table, we get all financial information for these three firms<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter\"><img decoding=\"async\" src=\"https:\/\/www.tejwin.com\/wp-content\/uploads\/0xkdufXM9K0UQ6uHS.png\" alt=\"\"\/><\/figure>\n\n\n\n<p id=\"06c6\">However, we find out it takes a bit longer to obtain this data. Thus, we must only&nbsp;<strong>select the financial accounts that we need in advance<\/strong>&nbsp;to speed up the obtaining time. To achieve that, the first thing we do is to look up the code of financial accounts<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">accounting = tejapi.get('TWN\/AIACC',<br>                       id = 'AIM1A', <br>                       paginate = True,<br>                       chinese_column_name = True)<\/pre>\n\n\n\n<p id=\"e66c\">Here we adopt&nbsp;<a href=\"https:\/\/api.tej.com.tw\/columndoc.html?subId=61\" rel=\"noreferrer noopener\" target=\"_blank\">financial accounts document<\/a>&nbsp;database. It\u2019s worth noting that we add&nbsp;<code>id = \u2018AIMIA\u2019<\/code>&nbsp;here to indicate we only need accounts from&nbsp;<a href=\"https:\/\/api.tej.com.tw\/columns.html?idCode=TWN%2FAIM1A\" rel=\"noreferrer noopener\" target=\"_blank\">IFRS consolidated cumulative reports of all industries<\/a>&nbsp;(TWN\/<strong>AIM1A<\/strong>)<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter\"><img decoding=\"async\" src=\"https:\/\/www.tejwin.com\/wp-content\/uploads\/0cLyt964D8t-NrDbw.png\" alt=\"\"\/><\/figure>\n\n\n\n<p id=\"e0ca\">Then all information of the accounts are presented, such as the codes, names and the financial reports they come from. We can use the data filtering method to find out the specific code of the accounts. For instance, if we are looking for depreciation related accounts, we can use the Chinese column and&nbsp;<code>str.contains()<\/code>&nbsp;to achieve it<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">depreciation = accounting[accounting['\u4e2d\u6587\u5168\u7a31'].str.contains('\u6298\u820a')]<\/pre>\n\n\n\n<figure class=\"wp-block-image aligncenter\"><img decoding=\"async\" src=\"https:\/\/www.tejwin.com\/wp-content\/uploads\/0hECky6EL8jToxr1G.png\" alt=\"\"\/><\/figure>\n\n\n\n<p id=\"954c\">If we cannot find anticipated accounts, we can turn to searching in the English column by its English name. If there are still tons of data after the first filtering, we can do the second or third filtering in the same way. For example, if we want that depreciation in the cash flow statement, we can utilize Chinese report column to filter.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">depreciation[depreciation['\u4e2d\u6587\u8868\u6b21'].str.contains('\u73fe\u91d1\u6d41\u91cf')]<\/pre>\n\n\n\n<figure class=\"wp-block-image aligncenter\"><img decoding=\"async\" src=\"https:\/\/www.tejwin.com\/wp-content\/uploads\/0byTbAwvnQ2vLUDO6.png\" alt=\"\"\/><\/figure>\n\n\n\n<p id=\"3cd8\">Now we can confirm the code of depreciation expense is&nbsp;<strong>7211<\/strong>. If we want all the financial accounts from balance sheet, we directly seek for them in Chinese report column with the key words of&nbsp;<strong>balance sheet<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">balance_sheet = accounting[accounting['\u4e2d\u6587\u8868\u6b21'].str.contains('\u8cc7\u7522\u8ca0\u50b5')]<\/pre>\n\n\n\n<p id=\"2267\">Then all accounts from balance sheet will be obtained<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter\"><img decoding=\"async\" src=\"https:\/\/www.tejwin.com\/wp-content\/uploads\/0fDuOvhKxL6hrxGsW.png\" alt=\"\"\/><\/figure>\n\n\n\n<pre class=\"wp-block-preformatted\">BS_list = balance_sheet['\u6703\u8a08\u79d1\u76ee'].tolist()<\/pre>\n\n\n\n<p id=\"e601\">In terms of the code column, we store all the values of it in a&nbsp;<code>BS_list<\/code>&nbsp;list<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter\"><img decoding=\"async\" src=\"https:\/\/www.tejwin.com\/wp-content\/uploads\/0aPB2A01LHrD3TBFA.png\" alt=\"\"\/><\/figure>\n\n\n\n<pre class=\"wp-block-preformatted\">finance = pd.DataFrame()<br>for firm in panel:<br>    finance = finance.append(tejapi.get('TWN\/AIM1A',<br>                    coid = firm,<br>                    paginate = True,<br>                    opts = {'pivot':True, 'columns': ['coid','mdate'] + BS_list},<br>                    chinese_column_name = True))<\/pre>\n\n\n\n<p id=\"55a9\">Next, we attach&nbsp;<code>BS_list<\/code>&nbsp;list to the columns selection in&nbsp;<code>opts<\/code>&nbsp;parameters, so those financial accounts will appear after the code of the firm and the date.<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter\"><img decoding=\"async\" src=\"https:\/\/www.tejwin.com\/wp-content\/uploads\/0T9fGQB2OhS2SnEeD.png\" alt=\"\"\/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"ef68\"><span class=\"ez-toc-section\" id=\"Basic_Financial_Data_Processing\"><\/span><strong>Basic Financial Data Processing<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Backup<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-preformatted\">fin = finance.copy()<\/pre>\n\n\n\n<p id=\"fcd9\">The purpose of this step is to&nbsp;<strong>avoid obtaining data repetitively<\/strong>&nbsp;because of unintentional modification of the raw data during data processing. It\u2019s especially important when dealing with tremendous amounts of data, not only because it&nbsp;<strong>wastes time to re-obtain<\/strong>, but also because we might<strong>&nbsp;exceed the daily data amount limitation<\/strong>. After the backup, we proceed with&nbsp;<code>fin&nbsp;<\/code>variable, and if we need to reset it to the original content of raw data, we can just re-run the code from this line<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Transform seasonal data to yearly data ( the following method is only&nbsp;<strong>limited to cumulative<\/strong>&nbsp;financial reports)<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-preformatted\">fin['\u6708'] = fin['\u8ca1\u5831\u5e74\u6708'].dt.month<\/pre>\n\n\n\n<p id=\"f69c\">First of all, we employ&nbsp;<code>dt.month<\/code>&nbsp;to extract the month figure from date column, and form an additional column<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter\"><img decoding=\"async\" src=\"https:\/\/www.tejwin.com\/wp-content\/uploads\/0o2x-YOpH4JiQOPCP.png\" alt=\"\"\/><\/figure>\n\n\n\n<pre class=\"wp-block-preformatted\">fin = fin[fin['\u6708'] == 12]<\/pre>\n\n\n\n<p id=\"7584\">Since those are cumulative financial data, we just need to select&nbsp;<strong>data in Q4&nbsp;<\/strong>to get our desired&nbsp;<strong>yearly data<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter\"><img decoding=\"async\" src=\"https:\/\/www.tejwin.com\/wp-content\/uploads\/0exYRf9yb1_2PL-Ia.png\" alt=\"\"\/><\/figure>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Sort<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-preformatted\">fin = fin.sort_values(by = ['\u8ca1\u5831\u5e74\u6708'], ascending = True)<\/pre>\n\n\n\n<p id=\"6e4a\">We use&nbsp;<code>sort_values()<\/code>&nbsp;and&nbsp;<code>ascending = True<\/code>&nbsp;to sort the date in a ascending way<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter\"><img decoding=\"async\" src=\"https:\/\/www.tejwin.com\/wp-content\/uploads\/0zgbXcUu4PdFlsqz3.png\" alt=\"\"\/><\/figure>\n\n\n\n<p id=\"1eeb\">If we want to further sort the assets amounts in a&nbsp;<strong>descending&nbsp;<\/strong>way within the same period<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">fin = fin.sort_values(by = ['\u8ca1\u5831\u5e74\u6708','\u8cc7\u7522\u7e3d\u984d'], ascending = [True, False])<\/pre>\n\n\n\n<figure class=\"wp-block-image aligncenter\"><img decoding=\"async\" src=\"https:\/\/www.tejwin.com\/wp-content\/uploads\/0TjGwB6VoQD5y87Lt.png\" alt=\"\"\/><\/figure>\n\n\n\n<p id=\"cfe4\">We can see after sorting those data, the index is disordered, so we normally reset the index after sorting<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">fin = fin.reset_index(drop=True)<\/pre>\n\n\n\n<figure class=\"wp-block-image aligncenter\"><img decoding=\"async\" src=\"https:\/\/www.tejwin.com\/wp-content\/uploads\/0FQwjYtZtrPd51bY2.png\" alt=\"\"\/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"f9f5\"><span class=\"ez-toc-section\" id=\"Conclusion\"><\/span><strong>Conclusion<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p id=\"74fc\">Financial data is helpful for evaluating the financial structure and operating performance of a company, and further impacting the investors\u2019 investment decisions. Therefore,&nbsp;<strong>the more comprehensive and intuitive the financial data is, the more convenient for us to do quantitative analysis<\/strong>. Today we demonstrate how to use pivot function of TEJ API paid database, obtain certain financial accounts and carry out simple data processing. If readers are interested in our database, we recommend you to go&nbsp;<a href=\"https:\/\/eshop.tej.com.tw\/E-Shop\/Edata_intro\" target=\"_blank\" rel=\"noreferrer noopener\">E-shop<\/a>&nbsp;to find out the optimal plan that suits your needs, so that you can discover more valuable information in the huge pool of financial data<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"6f2e\"><span class=\"ez-toc-section\" id=\"Related_Link\"><\/span><strong>Related Link<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/api.tej.com.tw\/index.html\" rel=\"noreferrer noopener\" target=\"_blank\">TEJ API<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/eshop.tej.com.tw\/E-Shop\/Edata_intro\" rel=\"noreferrer noopener\" target=\"_blank\">TEJ E-Shop<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Demonstrate how to get data from TEJ API financial database Preface Financial data is the information firms disclose each season, or financial indicators based on that information. Common financial data mainly comes from balance sheets, income statements or cash flow statements. Besides, TEJ API financial database also includes more comprehensive information such as&nbsp;financial ratios, related [&hellip;]<\/p>\n","protected":false},"featured_media":16151,"template":"","tags":[2904,2575,2583,2371,3006],"insight-category":[690,50,3509],"class_list":["post-16145","insight","type-insight","status-publish","has-post-thumbnail","hentry","tag-beginners-guide","tag-database","tag-finance","tag-python","tag-tejapi-beginners-guide","insight-category-data-analysis","insight-category-fintech","insight-category-fintech-en"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.tejwin.com\/en\/wp-json\/wp\/v2\/insight\/16145","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.tejwin.com\/en\/wp-json\/wp\/v2\/insight"}],"about":[{"href":"https:\/\/www.tejwin.com\/en\/wp-json\/wp\/v2\/types\/insight"}],"version-history":[{"count":1,"href":"https:\/\/www.tejwin.com\/en\/wp-json\/wp\/v2\/insight\/16145\/revisions"}],"predecessor-version":[{"id":24858,"href":"https:\/\/www.tejwin.com\/en\/wp-json\/wp\/v2\/insight\/16145\/revisions\/24858"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.tejwin.com\/en\/wp-json\/wp\/v2\/media\/16151"}],"wp:attachment":[{"href":"https:\/\/www.tejwin.com\/en\/wp-json\/wp\/v2\/media?parent=16145"}],"wp:term":[{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.tejwin.com\/en\/wp-json\/wp\/v2\/tags?post=16145"},{"taxonomy":"insight-category","embeddable":true,"href":"https:\/\/www.tejwin.com\/en\/wp-json\/wp\/v2\/insight-category?post=16145"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}