From 6f0e786aa334aa8fab1cc8a6740a4cd5300bb1bb Mon Sep 17 00:00:00 2001 From: thinh-vu Date: Tue, 29 Oct 2024 23:16:19 +0700 Subject: [PATCH] =?UTF-8?q?c=E1=BA=ADp=20nh=E1=BA=ADt=20c=C6=A1=20ch?= =?UTF-8?q?=E1=BA=BF=20lo=E1=BA=A1i=20b=E1=BB=8F=20c=E1=BB=99t=20tr=C3=B9n?= =?UTF-8?q?g=20trong=20BCTC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .DS_Store | Bin 12292 -> 14340 bytes .gitignore | 2 ++ vnstock3/explorer/vci/financial.py | 8 +++++++- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/.DS_Store b/.DS_Store index c21cf1f30620841fabbe351a848d0a73dff60ffe..5847762a2dd1c079b15adf74496c9a0055888474 100644 GIT binary patch delta 217 zcmZokXem%&U|?W$DortDU@!nOIe-{M3-ADmHU@FzD delta 371 zcmZoEXh~3DU|?W$DortDV9)?EIe-{M3-B;7uy8RjC~!|y&=)iZiZBBO85oioigSv~ z3MM9~Z+y_eJlVj6Wn#DBsc9+7)lv38FCm>a?%Zhlk;;6AUY*j zfHab9ZoZ34Qcivn$k01gz9FZRjya;MNFku2AOqP31)%oLrxaJQY`!8U$S4i64Gc86 zfs`w9P;9*To_R9AiLMSv9^|tI2o3fmkYECG!2rkx1tds~!Q>p1iJL1`elr4%7hnVc D$rDOU diff --git a/.gitignore b/.gitignore index 72c3deae..07a00e9b 100644 --- a/.gitignore +++ b/.gitignore @@ -25,3 +25,5 @@ vnstock3/.DS_Store vnstock3/.DS_Store vnstock3/.DS_Store docs/.DS_Store +dev/check_MSN_quarter_reports_df.xlsx +dev/MSN_quarter_reports_df.xlsx diff --git a/vnstock3/explorer/vci/financial.py b/vnstock3/explorer/vci/financial.py index cb64f1dd..5c28c48a 100644 --- a/vnstock3/explorer/vci/financial.py +++ b/vnstock3/explorer/vci/financial.py @@ -194,11 +194,17 @@ def _ratio_mapping (self, ratio_df:pd.DataFrame, lang:Optional[str]='en', show_l # Create a dictionary to map field_name to report type mapping_df = self._get_ratio_dict(get_all=False) # Filter the mapping DataFrame based on company type code. Split mapping into two parts: 'CT' and company-specific mapping - mapping_specific = mapping_df[mapping_df['com_type_code'] == self.com_type_code] + if self.com_type_code != 'CT': + mapping_specific = mapping_df[mapping_df['com_type_code'] == self.com_type_code] + else: + mapping_specific = pd.DataFrame() mapping_ct = mapping_df[mapping_df['com_type_code'] == 'CT'] all_columns_mapping = pd.concat([mapping_specific, mapping_ct]).drop_duplicates(subset='field_name', keep='first') all_columns_mapping = self.duplicated_columns_handling(all_columns_mapping, target_col_name=target_col_name) + # remove all values that com_type_code is not 'CT' or self.com_type_code + all_columns_mapping = all_columns_mapping[all_columns_mapping['com_type_code'].isin(['CT', self.com_type_code])].copy() + # # Filter the mapping DataFrame based on company type code. Split mapping into two parts: 'CT' and company-specific mapping # mapping_specific = mapping_df[mapping_df['com_type_code'] == self.com_type_code] # mapping_ct = mapping_df[mapping_df['com_type_code'] != self.com_type_code]