From 4bf32187f3ebe8af8501b69bb38e60d60765bc49 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E6=80=9D=E5=B7=9D?= Date: Tue, 28 Dec 2021 16:23:33 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20=E6=8C=87=E6=A0=87?= =?UTF-8?q?=E6=98=8E=E7=BB=86=E6=8E=A5=E5=8F=A3=20bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- company/scripts.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/company/scripts.py b/company/scripts.py index 8465b6c..1641892 100644 --- a/company/scripts.py +++ b/company/scripts.py @@ -27,7 +27,12 @@ def find_head_info_scripts(cid): def find_financial_index_detail_scripts(table, cid): - df = pd.DataFrame(find_data_in_company(table, {"企业ID": cid})).sort_values('年报期', ascending=False) + + index_detail = find_data_in_company(table, {"企业ID": cid}) + if not index_detail: + return False + + df = pd.DataFrame().sort_values('年报期', ascending=False) cols = [ '年报期', '净资产收益率',