diff --git a/Documents/QA_FINANCIAL.md b/Documents/QA_FINANCIAL.md
new file mode 100644
index 000000000..f055483bf
--- /dev/null
+++ b/Documents/QA_FINANCIAL.md
@@ -0,0 +1,651 @@
+# QUANTAXIS 的一般/高级财务方法
+
+
+1.QA.QA_fetch_financial_report(code,report_date)
+
+其中, report_date 是需要手动指定的财务时间, 可以是单个时间,也可以是一列时间:
+ > '2018-03-31' 或者['2017-03-31','2017-06-30','2017-09-31','2017-12-31','2018-03-31']
+ > 此方法的意义在于指定特定的财务时间(如年报)
+
+返回的是一个MultiIndex的dataframe
+
+2.QA.QA_fetch_financial_report_adv(code,start,end)
+
+支持随意的跨时间索引, start 和end不用刻意指定
+
+如果end不写,则start参数等同于report_date的用法
+
+返回的是QA_DataStruct_Financial 类
+
+3. QA_DataStruct_Financial 类, 可以直接加载在基础方法返回的dataframe中
+
+> QDF.get_report_by_date(code,date) 返回某个股票的某个时间点的财报
+
+> QDF.get_key(code,date,key) 返回某个股票某个时间点的财报的某个指标
+
+
+
+```python
+import QUANTAXIS as QA
+import pandas as pd
+
+```
+```python
+res=QA.QA_fetch_financial_report(['000001','600100'],['2017-03-31','2017-06-30','2017-09-31','2017-12-31','2018-03-31'])
+```
+
+
+```python
+res
+```
+
+
+
+
+
+
+
+
+
+ |
+ |
+ EPS |
+ deductEPS |
+ undistributedProfitPerShare |
+ netAssetsPerShare |
+ capitalReservePerShare |
+ ROE |
+ operatingCashFlowPerShare |
+ moneyFunds |
+ tradingFinancialAssets |
+ billsReceivables |
+ ... |
+ netProfitLastYear |
+ 277 |
+ 278 |
+ 279 |
+ 280 |
+ 281 |
+ 282 |
+ _id |
+ code |
+ report_date |
+
+
+ report_date |
+ code |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+
+
+
+
+ 2017-03-31 |
+ 000001 |
+ 0.3100 |
+ 0.3100 |
+ 4.05 |
+ 10.9400 |
+ 3.29 |
+ 2.992 |
+ -6.700 |
+ 7.121477e+11 |
+ 4.404400e+10 |
+ NaN |
+ ... |
+ 2.272700e+10 |
+ NaN |
+ NaN |
+ 2.0 |
+ 6.955837e+08 |
+ 2.89 |
+ 0.3617 |
+ 5b3edccc50d2c15048795415 |
+ 000001 |
+ 2017-03-31 |
+
+
+ 2017-06-30 |
+ 000001 |
+ 0.6800 |
+ 0.6800 |
+ 4.26 |
+ 11.1500 |
+ 3.29 |
+ 6.100 |
+ -7.470 |
+ 7.522773e+11 |
+ 4.908300e+10 |
+ NaN |
+ ... |
+ 2.286100e+10 |
+ NaN |
+ NaN |
+ 2.0 |
+ 7.684470e+08 |
+ 6.21 |
+ 0.3670 |
+ 5b3edcce50d2c15048796114 |
+ 000001 |
+ 2017-06-30 |
+
+
+ 2017-12-31 |
+ 000001 |
+ 1.3000 |
+ 1.3000 |
+ 4.64 |
+ 11.7706 |
+ 3.29 |
+ 11.474 |
+ -6.920 |
+ 7.506320e+11 |
+ 3.957500e+10 |
+ NaN |
+ ... |
+ 2.318900e+10 |
+ NaN |
+ NaN |
+ 3.0 |
+ 1.071157e+09 |
+ 11.62 |
+ 0.2348 |
+ 5b3edcd150d2c15048797c47 |
+ 000001 |
+ 2017-12-31 |
+
+
+ 2018-03-31 |
+ 000001 |
+ 0.3300 |
+ 0.3300 |
+ 4.69 |
+ 11.8500 |
+ 3.29 |
+ 3.242 |
+ 2.410 |
+ 6.699981e+11 |
+ 7.684500e+10 |
+ NaN |
+ ... |
+ 2.357000e+10 |
+ NaN |
+ NaN |
+ 3.0 |
+ 9.828775e+08 |
+ 2.79 |
+ 0.3818 |
+ 5b3edcd250d2c15048798a07 |
+ 000001 |
+ 2018-03-31 |
+
+
+ 2017-03-31 |
+ 600100 |
+ -0.0908 |
+ -0.1030 |
+ 2.57 |
+ 7.1879 |
+ 3.15 |
+ -1.263 |
+ -0.885 |
+ 7.738101e+09 |
+ 9.173491e+08 |
+ 90043088.0 |
+ ... |
+ -1.169131e+09 |
+ NaN |
+ NaN |
+ 3.0 |
+ 4.155126e+07 |
+ -1.25 |
+ -0.1030 |
+ 5b3edccc50d2c15048795c3a |
+ 600100 |
+ 2017-03-31 |
+
+
+ 2017-06-30 |
+ 600100 |
+ -0.0407 |
+ -0.0598 |
+ 2.37 |
+ 6.9775 |
+ 3.15 |
+ -0.584 |
+ -1.124 |
+ 8.756578e+09 |
+ 7.745308e+08 |
+ 52524456.0 |
+ ... |
+ -7.752181e+08 |
+ NaN |
+ NaN |
+ 3.0 |
+ 4.842445e+07 |
+ -0.56 |
+ 0.0432 |
+ 5b3edcce50d2c15048796987 |
+ 600100 |
+ 2017-06-30 |
+
+
+ 2017-12-31 |
+ 600100 |
+ 0.0350 |
+ -0.0115 |
+ 2.45 |
+ 7.1765 |
+ 3.10 |
+ 0.487 |
+ 0.153 |
+ 9.766134e+09 |
+ 5.818680e+08 |
+ 117617800.0 |
+ ... |
+ 1.036393e+08 |
+ NaN |
+ NaN |
+ 4.0 |
+ 5.628596e+07 |
+ 0.48 |
+ 0.0791 |
+ 5b3edcd150d2c150487984ca |
+ 600100 |
+ 2017-12-31 |
+
+
+ 2018-03-31 |
+ 600100 |
+ -0.0756 |
+ -0.0871 |
+ 2.37 |
+ 7.1433 |
+ 3.20 |
+ -1.058 |
+ -0.757 |
+ 7.666613e+09 |
+ 5.546273e+08 |
+ 97230120.0 |
+ ... |
+ 1.487741e+08 |
+ NaN |
+ NaN |
+ 2.0 |
+ 4.165037e+07 |
+ -1.06 |
+ -0.0871 |
+ 5b3edcd250d2c15048799289 |
+ 600100 |
+ 2018-03-31 |
+
+
+
+
8 rows × 285 columns
+
+
+
+
+
+```python
+res_adv=QA.QA_fetch_financial_report_adv('000001','2017-01-01','2018-05-01')
+```
+
+
+```python
+res_adv
+```
+
+
+
+
+ < QA_DataStruct_Financial >
+
+
+
+
+```python
+res_adv.data
+```
+
+
+
+
+
+
+
+
+
+ |
+ |
+ EPS |
+ deductEPS |
+ undistributedProfitPerShare |
+ netAssetsPerShare |
+ capitalReservePerShare |
+ ROE |
+ operatingCashFlowPerShare |
+ moneyFunds |
+ tradingFinancialAssets |
+ billsReceivables |
+ ... |
+ netProfitLastYear |
+ 277 |
+ 278 |
+ 279 |
+ 280 |
+ 281 |
+ 282 |
+ _id |
+ code |
+ report_date |
+
+
+ report_date |
+ code |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+ |
+
+
+
+
+ 2017-03-31 |
+ 000001 |
+ 0.31 |
+ 0.31 |
+ 4.05 |
+ 10.9400 |
+ 3.29 |
+ 2.992 |
+ -6.70 |
+ 7.121477e+11 |
+ 4.404400e+10 |
+ NaN |
+ ... |
+ 2.272700e+10 |
+ NaN |
+ NaN |
+ 2.0 |
+ 6.955837e+08 |
+ 2.89 |
+ 0.3617 |
+ 5b3edccc50d2c15048795415 |
+ 000001 |
+ 2017-03-31 |
+
+
+ 2017-06-30 |
+ 000001 |
+ 0.68 |
+ 0.68 |
+ 4.26 |
+ 11.1500 |
+ 3.29 |
+ 6.100 |
+ -7.47 |
+ 7.522773e+11 |
+ 4.908300e+10 |
+ NaN |
+ ... |
+ 2.286100e+10 |
+ NaN |
+ NaN |
+ 2.0 |
+ 7.684470e+08 |
+ 6.21 |
+ 0.3670 |
+ 5b3edcce50d2c15048796114 |
+ 000001 |
+ 2017-06-30 |
+
+
+ 2017-09-30 |
+ 000001 |
+ 1.06 |
+ 1.06 |
+ 4.64 |
+ 11.5400 |
+ 3.29 |
+ 8.782 |
+ -9.20 |
+ 7.265024e+11 |
+ 4.132700e+10 |
+ NaN |
+ ... |
+ 2.303300e+10 |
+ NaN |
+ NaN |
+ 3.0 |
+ 8.339691e+08 |
+ 9.60 |
+ 0.3854 |
+ 5b3edccf50d2c15048796eaa |
+ 000001 |
+ 2017-09-30 |
+
+
+ 2017-12-31 |
+ 000001 |
+ 1.30 |
+ 1.30 |
+ 4.64 |
+ 11.7706 |
+ 3.29 |
+ 11.474 |
+ -6.92 |
+ 7.506320e+11 |
+ 3.957500e+10 |
+ NaN |
+ ... |
+ 2.318900e+10 |
+ NaN |
+ NaN |
+ 3.0 |
+ 1.071157e+09 |
+ 11.62 |
+ 0.2348 |
+ 5b3edcd150d2c15048797c47 |
+ 000001 |
+ 2017-12-31 |
+
+
+ 2018-03-31 |
+ 000001 |
+ 0.33 |
+ 0.33 |
+ 4.69 |
+ 11.8500 |
+ 3.29 |
+ 3.242 |
+ 2.41 |
+ 6.699981e+11 |
+ 7.684500e+10 |
+ NaN |
+ ... |
+ 2.357000e+10 |
+ NaN |
+ NaN |
+ 3.0 |
+ 9.828775e+08 |
+ 2.79 |
+ 0.3818 |
+ 5b3edcd250d2c15048798a07 |
+ 000001 |
+ 2018-03-31 |
+
+
+
+
5 rows × 285 columns
+
+
+
+
+
+```python
+fds=QA.QA_DataStruct_Financial(res)
+```
+
+
+```python
+fds
+```
+
+
+
+
+ < QA_DataStruct_Financial >
+
+
+
+
+```python
+fds.get_key('600100','2017-03-31','ROE')
+```
+
+
+
+
+ -1.2630000114
+
+
+
+
+```python
+fds.get_report_by_date('600100','2017-03-31')
+```
+
+
+
+
+ EPS -0.0908
+ deductEPS -0.103
+ undistributedProfitPerShare 2.57
+ netAssetsPerShare 7.1879
+ capitalReservePerShare 3.15
+ ROE -1.263
+ operatingCashFlowPerShare -0.885
+ moneyFunds 7.7381e+09
+ tradingFinancialAssets 9.17349e+08
+ billsReceivables 9.00431e+07
+ accountsReceivables 7.19131e+09
+ prepayments 1.51541e+09
+ otherReceivables 9.41644e+08
+ interCompanyReceivables NaN
+ interestReceivables 0
+ dividendsReceivables 1.68134e+07
+ inventory 9.57452e+09
+ expendableBiologicalAssets NaN
+ noncurrentAssetsDueWithinOneYear 0
+ otherLiquidAssets 3.17298e+09
+ totalLiquidAssets 3.11582e+10
+ availableForSaleSecurities 2.92698e+09
+ heldToMaturityInvestments 0
+ longTermReceivables 8.95877e+08
+ longTermEquityInvestment 1.33009e+10
+ investmentRealEstate 1.45896e+07
+ fixedAssets 3.26195e+09
+ constructionInProgress 6.67087e+08
+ engineerMaterial 0
+ fixedAssetsCleanUp 0
+ ...
+ socialSecurityNumber NaN
+ socialSecurityShareholding NaN
+ privateEquityNumber 1
+ privateEquityShareholding 8.00007e+06
+ financialCompanyNumber NaN
+ financialCompanyShareholding NaN
+ pensionInsuranceAgencyNumber NaN
+ pensionInsuranceAgencyShareholfing NaN
+ totalNumberOfTopTenCirculationShareholders 5.85248e+08
+ firstLargeCirculationShareholdersNumber 4.73639e+08
+ freeCirculationStock 1.72424e+09
+ limitedCirculationAShares 7.66017e+08
+ generalRiskPreparation NaN
+ otherComprehensiveIncome -2.10654e+08
+ totalComprehensiveIncome -5.05396e+08
+ shareholdersOwnershipOfAParentCompany 2.13041e+10
+ bankInstutionNumber NaN
+ bankInstutionShareholding NaN
+ corporationNumber 1
+ corporationShareholding 4.73639e+08
+ netProfitLastYear -1.16913e+09
+ 277 NaN
+ 278 NaN
+ 279 3
+ 280 4.15513e+07
+ 281 -1.25
+ 282 -0.103
+ _id 5b3edccc50d2c15048795c3a
+ code 600100
+ report_date 2017-03-31 00:00:00
+ Name: (2017-03-31 00:00:00, 600100), Length: 285, dtype: object
+
+
+
+
+```python
+
+
+```
diff --git a/QUANTAXIS/QAData/QAFinancialStruct.py b/QUANTAXIS/QAData/QAFinancialStruct.py
index 48900091c..a48d16bee 100644
--- a/QUANTAXIS/QAData/QAFinancialStruct.py
+++ b/QUANTAXIS/QAData/QAFinancialStruct.py
@@ -44,8 +44,8 @@ def __repr__(self):
def get_report_by_date(self, code, date):
return self.data.loc[pd.Timestamp(date), code]
- def get_key(self, code, reportdate, values):
+ def get_key(self, code, reportdate, key):
if isinstance(reportdate, list):
- return self.data.loc[(slice(pd.Timestamp(reportdate[0]), pd.Timestamp(reportdate[-1])), code), values]
+ return self.data.loc[(slice(pd.Timestamp(reportdate[0]), pd.Timestamp(reportdate[-1])), code), key]
else:
- return self.data.loc[(pd.Timestamp(reportdate), code), values]
+ return self.data.loc[(pd.Timestamp(reportdate), code), key]
diff --git a/jupyterexample/QA_FINANCIAL.ipynb b/jupyterexample/QA_FINANCIAL.ipynb
new file mode 100644
index 000000000..d657bd50e
--- /dev/null
+++ b/jupyterexample/QA_FINANCIAL.ipynb
@@ -0,0 +1,891 @@
+{
+ "cells": [
+ {
+ "cell_type": "code",
+ "execution_count": 12,
+ "metadata": {
+ "scrolled": true
+ },
+ "outputs": [],
+ "source": [
+ "import QUANTAXIS as QA\n",
+ "import pandas as pd\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## QUANTAXIS 的一般/高级财务方法\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "1.QA.QA_fetch_financial_report(code,report_date)\n",
+ "\n",
+ "其中, report_date 是需要手动指定的财务时间, 可以是单个时间,也可以是一列时间:\n",
+ " > '2018-03-31' 或者['2017-03-31','2017-06-30','2017-09-31','2017-12-31','2018-03-31']\n",
+ " > 此方法的意义在于指定特定的财务时间(如年报)\n",
+ " \n",
+ "返回的是一个MultiIndex的dataframe\n",
+ " \n",
+ "2.QA.QA_fetch_financial_report_adv(code,start,end)\n",
+ "\n",
+ "支持随意的跨时间索引, start 和end不用刻意指定\n",
+ "\n",
+ "如果end不写,则start参数等同于report_date的用法\n",
+ "\n",
+ "返回的是QA_DataStruct_Financial 类\n",
+ "\n",
+ "3. QA_DataStruct_Financial 类, 可以直接加载在基础方法返回的dataframe中\n",
+ "\n",
+ "> QDF.get_report_by_date(code,date) 返回某个股票的某个时间点的财报\n",
+ "\n",
+ "> QDF.get_key(code,date,key) 返回某个股票某个时间点的财报的某个指标"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 3,
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "res=QA.QA_fetch_financial_report(['000001','600100'],['2017-03-31','2017-06-30','2017-09-31','2017-12-31','2018-03-31'])"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 4,
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/html": [
+ "\n",
+ "\n",
+ "
\n",
+ " \n",
+ " \n",
+ " | \n",
+ " | \n",
+ " EPS | \n",
+ " deductEPS | \n",
+ " undistributedProfitPerShare | \n",
+ " netAssetsPerShare | \n",
+ " capitalReservePerShare | \n",
+ " ROE | \n",
+ " operatingCashFlowPerShare | \n",
+ " moneyFunds | \n",
+ " tradingFinancialAssets | \n",
+ " billsReceivables | \n",
+ " ... | \n",
+ " netProfitLastYear | \n",
+ " 277 | \n",
+ " 278 | \n",
+ " 279 | \n",
+ " 280 | \n",
+ " 281 | \n",
+ " 282 | \n",
+ " _id | \n",
+ " code | \n",
+ " report_date | \n",
+ "
\n",
+ " \n",
+ " report_date | \n",
+ " code | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " 2017-03-31 | \n",
+ " 000001 | \n",
+ " 0.3100 | \n",
+ " 0.3100 | \n",
+ " 4.05 | \n",
+ " 10.9400 | \n",
+ " 3.29 | \n",
+ " 2.992 | \n",
+ " -6.700 | \n",
+ " 7.121477e+11 | \n",
+ " 4.404400e+10 | \n",
+ " NaN | \n",
+ " ... | \n",
+ " 2.272700e+10 | \n",
+ " NaN | \n",
+ " NaN | \n",
+ " 2.0 | \n",
+ " 6.955837e+08 | \n",
+ " 2.89 | \n",
+ " 0.3617 | \n",
+ " 5b3edccc50d2c15048795415 | \n",
+ " 000001 | \n",
+ " 2017-03-31 | \n",
+ "
\n",
+ " \n",
+ " 2017-06-30 | \n",
+ " 000001 | \n",
+ " 0.6800 | \n",
+ " 0.6800 | \n",
+ " 4.26 | \n",
+ " 11.1500 | \n",
+ " 3.29 | \n",
+ " 6.100 | \n",
+ " -7.470 | \n",
+ " 7.522773e+11 | \n",
+ " 4.908300e+10 | \n",
+ " NaN | \n",
+ " ... | \n",
+ " 2.286100e+10 | \n",
+ " NaN | \n",
+ " NaN | \n",
+ " 2.0 | \n",
+ " 7.684470e+08 | \n",
+ " 6.21 | \n",
+ " 0.3670 | \n",
+ " 5b3edcce50d2c15048796114 | \n",
+ " 000001 | \n",
+ " 2017-06-30 | \n",
+ "
\n",
+ " \n",
+ " 2017-12-31 | \n",
+ " 000001 | \n",
+ " 1.3000 | \n",
+ " 1.3000 | \n",
+ " 4.64 | \n",
+ " 11.7706 | \n",
+ " 3.29 | \n",
+ " 11.474 | \n",
+ " -6.920 | \n",
+ " 7.506320e+11 | \n",
+ " 3.957500e+10 | \n",
+ " NaN | \n",
+ " ... | \n",
+ " 2.318900e+10 | \n",
+ " NaN | \n",
+ " NaN | \n",
+ " 3.0 | \n",
+ " 1.071157e+09 | \n",
+ " 11.62 | \n",
+ " 0.2348 | \n",
+ " 5b3edcd150d2c15048797c47 | \n",
+ " 000001 | \n",
+ " 2017-12-31 | \n",
+ "
\n",
+ " \n",
+ " 2018-03-31 | \n",
+ " 000001 | \n",
+ " 0.3300 | \n",
+ " 0.3300 | \n",
+ " 4.69 | \n",
+ " 11.8500 | \n",
+ " 3.29 | \n",
+ " 3.242 | \n",
+ " 2.410 | \n",
+ " 6.699981e+11 | \n",
+ " 7.684500e+10 | \n",
+ " NaN | \n",
+ " ... | \n",
+ " 2.357000e+10 | \n",
+ " NaN | \n",
+ " NaN | \n",
+ " 3.0 | \n",
+ " 9.828775e+08 | \n",
+ " 2.79 | \n",
+ " 0.3818 | \n",
+ " 5b3edcd250d2c15048798a07 | \n",
+ " 000001 | \n",
+ " 2018-03-31 | \n",
+ "
\n",
+ " \n",
+ " 2017-03-31 | \n",
+ " 600100 | \n",
+ " -0.0908 | \n",
+ " -0.1030 | \n",
+ " 2.57 | \n",
+ " 7.1879 | \n",
+ " 3.15 | \n",
+ " -1.263 | \n",
+ " -0.885 | \n",
+ " 7.738101e+09 | \n",
+ " 9.173491e+08 | \n",
+ " 90043088.0 | \n",
+ " ... | \n",
+ " -1.169131e+09 | \n",
+ " NaN | \n",
+ " NaN | \n",
+ " 3.0 | \n",
+ " 4.155126e+07 | \n",
+ " -1.25 | \n",
+ " -0.1030 | \n",
+ " 5b3edccc50d2c15048795c3a | \n",
+ " 600100 | \n",
+ " 2017-03-31 | \n",
+ "
\n",
+ " \n",
+ " 2017-06-30 | \n",
+ " 600100 | \n",
+ " -0.0407 | \n",
+ " -0.0598 | \n",
+ " 2.37 | \n",
+ " 6.9775 | \n",
+ " 3.15 | \n",
+ " -0.584 | \n",
+ " -1.124 | \n",
+ " 8.756578e+09 | \n",
+ " 7.745308e+08 | \n",
+ " 52524456.0 | \n",
+ " ... | \n",
+ " -7.752181e+08 | \n",
+ " NaN | \n",
+ " NaN | \n",
+ " 3.0 | \n",
+ " 4.842445e+07 | \n",
+ " -0.56 | \n",
+ " 0.0432 | \n",
+ " 5b3edcce50d2c15048796987 | \n",
+ " 600100 | \n",
+ " 2017-06-30 | \n",
+ "
\n",
+ " \n",
+ " 2017-12-31 | \n",
+ " 600100 | \n",
+ " 0.0350 | \n",
+ " -0.0115 | \n",
+ " 2.45 | \n",
+ " 7.1765 | \n",
+ " 3.10 | \n",
+ " 0.487 | \n",
+ " 0.153 | \n",
+ " 9.766134e+09 | \n",
+ " 5.818680e+08 | \n",
+ " 117617800.0 | \n",
+ " ... | \n",
+ " 1.036393e+08 | \n",
+ " NaN | \n",
+ " NaN | \n",
+ " 4.0 | \n",
+ " 5.628596e+07 | \n",
+ " 0.48 | \n",
+ " 0.0791 | \n",
+ " 5b3edcd150d2c150487984ca | \n",
+ " 600100 | \n",
+ " 2017-12-31 | \n",
+ "
\n",
+ " \n",
+ " 2018-03-31 | \n",
+ " 600100 | \n",
+ " -0.0756 | \n",
+ " -0.0871 | \n",
+ " 2.37 | \n",
+ " 7.1433 | \n",
+ " 3.20 | \n",
+ " -1.058 | \n",
+ " -0.757 | \n",
+ " 7.666613e+09 | \n",
+ " 5.546273e+08 | \n",
+ " 97230120.0 | \n",
+ " ... | \n",
+ " 1.487741e+08 | \n",
+ " NaN | \n",
+ " NaN | \n",
+ " 2.0 | \n",
+ " 4.165037e+07 | \n",
+ " -1.06 | \n",
+ " -0.0871 | \n",
+ " 5b3edcd250d2c15048799289 | \n",
+ " 600100 | \n",
+ " 2018-03-31 | \n",
+ "
\n",
+ " \n",
+ "
\n",
+ "
8 rows × 285 columns
\n",
+ "
"
+ ],
+ "text/plain": [
+ " EPS deductEPS undistributedProfitPerShare \\\n",
+ "report_date code \n",
+ "2017-03-31 000001 0.3100 0.3100 4.05 \n",
+ "2017-06-30 000001 0.6800 0.6800 4.26 \n",
+ "2017-12-31 000001 1.3000 1.3000 4.64 \n",
+ "2018-03-31 000001 0.3300 0.3300 4.69 \n",
+ "2017-03-31 600100 -0.0908 -0.1030 2.57 \n",
+ "2017-06-30 600100 -0.0407 -0.0598 2.37 \n",
+ "2017-12-31 600100 0.0350 -0.0115 2.45 \n",
+ "2018-03-31 600100 -0.0756 -0.0871 2.37 \n",
+ "\n",
+ " netAssetsPerShare capitalReservePerShare ROE \\\n",
+ "report_date code \n",
+ "2017-03-31 000001 10.9400 3.29 2.992 \n",
+ "2017-06-30 000001 11.1500 3.29 6.100 \n",
+ "2017-12-31 000001 11.7706 3.29 11.474 \n",
+ "2018-03-31 000001 11.8500 3.29 3.242 \n",
+ "2017-03-31 600100 7.1879 3.15 -1.263 \n",
+ "2017-06-30 600100 6.9775 3.15 -0.584 \n",
+ "2017-12-31 600100 7.1765 3.10 0.487 \n",
+ "2018-03-31 600100 7.1433 3.20 -1.058 \n",
+ "\n",
+ " operatingCashFlowPerShare moneyFunds \\\n",
+ "report_date code \n",
+ "2017-03-31 000001 -6.700 7.121477e+11 \n",
+ "2017-06-30 000001 -7.470 7.522773e+11 \n",
+ "2017-12-31 000001 -6.920 7.506320e+11 \n",
+ "2018-03-31 000001 2.410 6.699981e+11 \n",
+ "2017-03-31 600100 -0.885 7.738101e+09 \n",
+ "2017-06-30 600100 -1.124 8.756578e+09 \n",
+ "2017-12-31 600100 0.153 9.766134e+09 \n",
+ "2018-03-31 600100 -0.757 7.666613e+09 \n",
+ "\n",
+ " tradingFinancialAssets billsReceivables ... \\\n",
+ "report_date code ... \n",
+ "2017-03-31 000001 4.404400e+10 NaN ... \n",
+ "2017-06-30 000001 4.908300e+10 NaN ... \n",
+ "2017-12-31 000001 3.957500e+10 NaN ... \n",
+ "2018-03-31 000001 7.684500e+10 NaN ... \n",
+ "2017-03-31 600100 9.173491e+08 90043088.0 ... \n",
+ "2017-06-30 600100 7.745308e+08 52524456.0 ... \n",
+ "2017-12-31 600100 5.818680e+08 117617800.0 ... \n",
+ "2018-03-31 600100 5.546273e+08 97230120.0 ... \n",
+ "\n",
+ " netProfitLastYear 277 278 279 280 281 \\\n",
+ "report_date code \n",
+ "2017-03-31 000001 2.272700e+10 NaN NaN 2.0 6.955837e+08 2.89 \n",
+ "2017-06-30 000001 2.286100e+10 NaN NaN 2.0 7.684470e+08 6.21 \n",
+ "2017-12-31 000001 2.318900e+10 NaN NaN 3.0 1.071157e+09 11.62 \n",
+ "2018-03-31 000001 2.357000e+10 NaN NaN 3.0 9.828775e+08 2.79 \n",
+ "2017-03-31 600100 -1.169131e+09 NaN NaN 3.0 4.155126e+07 -1.25 \n",
+ "2017-06-30 600100 -7.752181e+08 NaN NaN 3.0 4.842445e+07 -0.56 \n",
+ "2017-12-31 600100 1.036393e+08 NaN NaN 4.0 5.628596e+07 0.48 \n",
+ "2018-03-31 600100 1.487741e+08 NaN NaN 2.0 4.165037e+07 -1.06 \n",
+ "\n",
+ " 282 _id code report_date \n",
+ "report_date code \n",
+ "2017-03-31 000001 0.3617 5b3edccc50d2c15048795415 000001 2017-03-31 \n",
+ "2017-06-30 000001 0.3670 5b3edcce50d2c15048796114 000001 2017-06-30 \n",
+ "2017-12-31 000001 0.2348 5b3edcd150d2c15048797c47 000001 2017-12-31 \n",
+ "2018-03-31 000001 0.3818 5b3edcd250d2c15048798a07 000001 2018-03-31 \n",
+ "2017-03-31 600100 -0.1030 5b3edccc50d2c15048795c3a 600100 2017-03-31 \n",
+ "2017-06-30 600100 0.0432 5b3edcce50d2c15048796987 600100 2017-06-30 \n",
+ "2017-12-31 600100 0.0791 5b3edcd150d2c150487984ca 600100 2017-12-31 \n",
+ "2018-03-31 600100 -0.0871 5b3edcd250d2c15048799289 600100 2018-03-31 \n",
+ "\n",
+ "[8 rows x 285 columns]"
+ ]
+ },
+ "execution_count": 4,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "res"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 5,
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "res_adv=QA.QA_fetch_financial_report_adv('000001','2017-01-01','2018-05-01')"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 9,
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/plain": [
+ "< QA_DataStruct_Financial >"
+ ]
+ },
+ "execution_count": 9,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "res_adv"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 11,
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/html": [
+ "\n",
+ "\n",
+ "
\n",
+ " \n",
+ " \n",
+ " | \n",
+ " | \n",
+ " EPS | \n",
+ " deductEPS | \n",
+ " undistributedProfitPerShare | \n",
+ " netAssetsPerShare | \n",
+ " capitalReservePerShare | \n",
+ " ROE | \n",
+ " operatingCashFlowPerShare | \n",
+ " moneyFunds | \n",
+ " tradingFinancialAssets | \n",
+ " billsReceivables | \n",
+ " ... | \n",
+ " netProfitLastYear | \n",
+ " 277 | \n",
+ " 278 | \n",
+ " 279 | \n",
+ " 280 | \n",
+ " 281 | \n",
+ " 282 | \n",
+ " _id | \n",
+ " code | \n",
+ " report_date | \n",
+ "
\n",
+ " \n",
+ " report_date | \n",
+ " code | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ " | \n",
+ "
\n",
+ " \n",
+ " \n",
+ " \n",
+ " 2017-03-31 | \n",
+ " 000001 | \n",
+ " 0.31 | \n",
+ " 0.31 | \n",
+ " 4.05 | \n",
+ " 10.9400 | \n",
+ " 3.29 | \n",
+ " 2.992 | \n",
+ " -6.70 | \n",
+ " 7.121477e+11 | \n",
+ " 4.404400e+10 | \n",
+ " NaN | \n",
+ " ... | \n",
+ " 2.272700e+10 | \n",
+ " NaN | \n",
+ " NaN | \n",
+ " 2.0 | \n",
+ " 6.955837e+08 | \n",
+ " 2.89 | \n",
+ " 0.3617 | \n",
+ " 5b3edccc50d2c15048795415 | \n",
+ " 000001 | \n",
+ " 2017-03-31 | \n",
+ "
\n",
+ " \n",
+ " 2017-06-30 | \n",
+ " 000001 | \n",
+ " 0.68 | \n",
+ " 0.68 | \n",
+ " 4.26 | \n",
+ " 11.1500 | \n",
+ " 3.29 | \n",
+ " 6.100 | \n",
+ " -7.47 | \n",
+ " 7.522773e+11 | \n",
+ " 4.908300e+10 | \n",
+ " NaN | \n",
+ " ... | \n",
+ " 2.286100e+10 | \n",
+ " NaN | \n",
+ " NaN | \n",
+ " 2.0 | \n",
+ " 7.684470e+08 | \n",
+ " 6.21 | \n",
+ " 0.3670 | \n",
+ " 5b3edcce50d2c15048796114 | \n",
+ " 000001 | \n",
+ " 2017-06-30 | \n",
+ "
\n",
+ " \n",
+ " 2017-09-30 | \n",
+ " 000001 | \n",
+ " 1.06 | \n",
+ " 1.06 | \n",
+ " 4.64 | \n",
+ " 11.5400 | \n",
+ " 3.29 | \n",
+ " 8.782 | \n",
+ " -9.20 | \n",
+ " 7.265024e+11 | \n",
+ " 4.132700e+10 | \n",
+ " NaN | \n",
+ " ... | \n",
+ " 2.303300e+10 | \n",
+ " NaN | \n",
+ " NaN | \n",
+ " 3.0 | \n",
+ " 8.339691e+08 | \n",
+ " 9.60 | \n",
+ " 0.3854 | \n",
+ " 5b3edccf50d2c15048796eaa | \n",
+ " 000001 | \n",
+ " 2017-09-30 | \n",
+ "
\n",
+ " \n",
+ " 2017-12-31 | \n",
+ " 000001 | \n",
+ " 1.30 | \n",
+ " 1.30 | \n",
+ " 4.64 | \n",
+ " 11.7706 | \n",
+ " 3.29 | \n",
+ " 11.474 | \n",
+ " -6.92 | \n",
+ " 7.506320e+11 | \n",
+ " 3.957500e+10 | \n",
+ " NaN | \n",
+ " ... | \n",
+ " 2.318900e+10 | \n",
+ " NaN | \n",
+ " NaN | \n",
+ " 3.0 | \n",
+ " 1.071157e+09 | \n",
+ " 11.62 | \n",
+ " 0.2348 | \n",
+ " 5b3edcd150d2c15048797c47 | \n",
+ " 000001 | \n",
+ " 2017-12-31 | \n",
+ "
\n",
+ " \n",
+ " 2018-03-31 | \n",
+ " 000001 | \n",
+ " 0.33 | \n",
+ " 0.33 | \n",
+ " 4.69 | \n",
+ " 11.8500 | \n",
+ " 3.29 | \n",
+ " 3.242 | \n",
+ " 2.41 | \n",
+ " 6.699981e+11 | \n",
+ " 7.684500e+10 | \n",
+ " NaN | \n",
+ " ... | \n",
+ " 2.357000e+10 | \n",
+ " NaN | \n",
+ " NaN | \n",
+ " 3.0 | \n",
+ " 9.828775e+08 | \n",
+ " 2.79 | \n",
+ " 0.3818 | \n",
+ " 5b3edcd250d2c15048798a07 | \n",
+ " 000001 | \n",
+ " 2018-03-31 | \n",
+ "
\n",
+ " \n",
+ "
\n",
+ "
5 rows × 285 columns
\n",
+ "
"
+ ],
+ "text/plain": [
+ " EPS deductEPS undistributedProfitPerShare \\\n",
+ "report_date code \n",
+ "2017-03-31 000001 0.31 0.31 4.05 \n",
+ "2017-06-30 000001 0.68 0.68 4.26 \n",
+ "2017-09-30 000001 1.06 1.06 4.64 \n",
+ "2017-12-31 000001 1.30 1.30 4.64 \n",
+ "2018-03-31 000001 0.33 0.33 4.69 \n",
+ "\n",
+ " netAssetsPerShare capitalReservePerShare ROE \\\n",
+ "report_date code \n",
+ "2017-03-31 000001 10.9400 3.29 2.992 \n",
+ "2017-06-30 000001 11.1500 3.29 6.100 \n",
+ "2017-09-30 000001 11.5400 3.29 8.782 \n",
+ "2017-12-31 000001 11.7706 3.29 11.474 \n",
+ "2018-03-31 000001 11.8500 3.29 3.242 \n",
+ "\n",
+ " operatingCashFlowPerShare moneyFunds \\\n",
+ "report_date code \n",
+ "2017-03-31 000001 -6.70 7.121477e+11 \n",
+ "2017-06-30 000001 -7.47 7.522773e+11 \n",
+ "2017-09-30 000001 -9.20 7.265024e+11 \n",
+ "2017-12-31 000001 -6.92 7.506320e+11 \n",
+ "2018-03-31 000001 2.41 6.699981e+11 \n",
+ "\n",
+ " tradingFinancialAssets billsReceivables ... \\\n",
+ "report_date code ... \n",
+ "2017-03-31 000001 4.404400e+10 NaN ... \n",
+ "2017-06-30 000001 4.908300e+10 NaN ... \n",
+ "2017-09-30 000001 4.132700e+10 NaN ... \n",
+ "2017-12-31 000001 3.957500e+10 NaN ... \n",
+ "2018-03-31 000001 7.684500e+10 NaN ... \n",
+ "\n",
+ " netProfitLastYear 277 278 279 280 281 \\\n",
+ "report_date code \n",
+ "2017-03-31 000001 2.272700e+10 NaN NaN 2.0 6.955837e+08 2.89 \n",
+ "2017-06-30 000001 2.286100e+10 NaN NaN 2.0 7.684470e+08 6.21 \n",
+ "2017-09-30 000001 2.303300e+10 NaN NaN 3.0 8.339691e+08 9.60 \n",
+ "2017-12-31 000001 2.318900e+10 NaN NaN 3.0 1.071157e+09 11.62 \n",
+ "2018-03-31 000001 2.357000e+10 NaN NaN 3.0 9.828775e+08 2.79 \n",
+ "\n",
+ " 282 _id code report_date \n",
+ "report_date code \n",
+ "2017-03-31 000001 0.3617 5b3edccc50d2c15048795415 000001 2017-03-31 \n",
+ "2017-06-30 000001 0.3670 5b3edcce50d2c15048796114 000001 2017-06-30 \n",
+ "2017-09-30 000001 0.3854 5b3edccf50d2c15048796eaa 000001 2017-09-30 \n",
+ "2017-12-31 000001 0.2348 5b3edcd150d2c15048797c47 000001 2017-12-31 \n",
+ "2018-03-31 000001 0.3818 5b3edcd250d2c15048798a07 000001 2018-03-31 \n",
+ "\n",
+ "[5 rows x 285 columns]"
+ ]
+ },
+ "execution_count": 11,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "res_adv.data"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 14,
+ "metadata": {
+ "scrolled": true
+ },
+ "outputs": [],
+ "source": [
+ "fds=QA.QA_DataStruct_Financial(res)"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 15,
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/plain": [
+ "< QA_DataStruct_Financial >"
+ ]
+ },
+ "execution_count": 15,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "fds"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 16,
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/plain": [
+ "-1.2630000114"
+ ]
+ },
+ "execution_count": 16,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "fds.get_key('600100','2017-03-31','ROE')"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 17,
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/plain": [
+ "EPS -0.0908\n",
+ "deductEPS -0.103\n",
+ "undistributedProfitPerShare 2.57\n",
+ "netAssetsPerShare 7.1879\n",
+ "capitalReservePerShare 3.15\n",
+ "ROE -1.263\n",
+ "operatingCashFlowPerShare -0.885\n",
+ "moneyFunds 7.7381e+09\n",
+ "tradingFinancialAssets 9.17349e+08\n",
+ "billsReceivables 9.00431e+07\n",
+ "accountsReceivables 7.19131e+09\n",
+ "prepayments 1.51541e+09\n",
+ "otherReceivables 9.41644e+08\n",
+ "interCompanyReceivables NaN\n",
+ "interestReceivables 0\n",
+ "dividendsReceivables 1.68134e+07\n",
+ "inventory 9.57452e+09\n",
+ "expendableBiologicalAssets NaN\n",
+ "noncurrentAssetsDueWithinOneYear 0\n",
+ "otherLiquidAssets 3.17298e+09\n",
+ "totalLiquidAssets 3.11582e+10\n",
+ "availableForSaleSecurities 2.92698e+09\n",
+ "heldToMaturityInvestments 0\n",
+ "longTermReceivables 8.95877e+08\n",
+ "longTermEquityInvestment 1.33009e+10\n",
+ "investmentRealEstate 1.45896e+07\n",
+ "fixedAssets 3.26195e+09\n",
+ "constructionInProgress 6.67087e+08\n",
+ "engineerMaterial 0\n",
+ "fixedAssetsCleanUp 0\n",
+ " ... \n",
+ "socialSecurityNumber NaN\n",
+ "socialSecurityShareholding NaN\n",
+ "privateEquityNumber 1\n",
+ "privateEquityShareholding 8.00007e+06\n",
+ "financialCompanyNumber NaN\n",
+ "financialCompanyShareholding NaN\n",
+ "pensionInsuranceAgencyNumber NaN\n",
+ "pensionInsuranceAgencyShareholfing NaN\n",
+ "totalNumberOfTopTenCirculationShareholders 5.85248e+08\n",
+ "firstLargeCirculationShareholdersNumber 4.73639e+08\n",
+ "freeCirculationStock 1.72424e+09\n",
+ "limitedCirculationAShares 7.66017e+08\n",
+ "generalRiskPreparation NaN\n",
+ "otherComprehensiveIncome -2.10654e+08\n",
+ "totalComprehensiveIncome -5.05396e+08\n",
+ "shareholdersOwnershipOfAParentCompany 2.13041e+10\n",
+ "bankInstutionNumber NaN\n",
+ "bankInstutionShareholding NaN\n",
+ "corporationNumber 1\n",
+ "corporationShareholding 4.73639e+08\n",
+ "netProfitLastYear -1.16913e+09\n",
+ "277 NaN\n",
+ "278 NaN\n",
+ "279 3\n",
+ "280 4.15513e+07\n",
+ "281 -1.25\n",
+ "282 -0.103\n",
+ "_id 5b3edccc50d2c15048795c3a\n",
+ "code 600100\n",
+ "report_date 2017-03-31 00:00:00\n",
+ "Name: (2017-03-31 00:00:00, 600100), Length: 285, dtype: object"
+ ]
+ },
+ "execution_count": 17,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "fds.get_report_by_date('600100','2017-03-31')"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {},
+ "outputs": [],
+ "source": []
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {},
+ "outputs": [],
+ "source": []
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "\n"
+ ]
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "Python 3",
+ "language": "python",
+ "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.6.5"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 2
+}