PyQuantimClient 1.0.73__tar.gz → 1.0.74__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: PyQuantimClient
3
- Version: 1.0.73
3
+ Version: 1.0.74
4
4
  Summary: Python client to access quantIM services
5
5
  Author: Daniel Velasquez
6
6
  Author-email: daniel.velasquez@sura-im.com
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: PyQuantimClient
3
- Version: 1.0.73
3
+ Version: 1.0.74
4
4
  Summary: Python client to access quantIM services
5
5
  Author: Daniel Velasquez
6
6
  Author-email: daniel.velasquez@sura-im.com
@@ -4,7 +4,7 @@ setup(
4
4
  name='PyQuantimClient',
5
5
  packages=['PyQuantimClient'],
6
6
  package_dir={'PyQuantimClient': 'src'},
7
- version='1.0.73',
7
+ version='1.0.74',
8
8
  description='Python client to access quantIM services',
9
9
  author='Daniel Velasquez',
10
10
  author_email='daniel.velasquez@sura-im.com',
@@ -68,10 +68,25 @@ class bi_data(quantim):
68
68
 
69
69
  # Por region
70
70
  region_df = resp_dfs["INVERSION EN EL EXTRANJERO DEL LOS FONDOS DE PENSIONES, DIVERSIFICACION POR TIPO DE FONDO Y ZONA GEOGRAFICA"]
71
+ columnas = ["monto_dolares", "porcentaje", "porcentaje_sobre_extranjero"]
72
+ region_df[columnas] = region_df[columnas].apply(pd.to_numeric)
73
+
71
74
  region_df['index'] = region_df['index'].str.replace('tipofondo -', '').str.strip()
72
75
  region_df = region_df.loc[np.in1d(region_df['index'], ['A', 'B', 'C', 'D', 'E'])]
76
+
73
77
  region_df = region_df.groupby(['index', 'glosa']).sum().reset_index(level='index')
74
78
  region_df = region_df.pivot(columns='index', values='monto_dolares').reset_index()
75
79
 
80
+ columnas = ['A', 'B', 'C', 'D', 'E']
81
+
82
+ for columna in columnas:
83
+ divisor = region_df[columna].iloc[8]
84
+ region_df[columna] = region_df[columna] / divisor * 100
85
+
86
+ region_df = region_df.rename(columns={"glosa": "Clase de Activo"})
87
+
88
+ # Consolidado
89
+ final_df = pd.concat([consol_df, region_df], axis=0)
90
+ final_df = final_df[final_df["Clase de Activo"] != "TOTAL INVERSION EN EL EXTRANJERO"]
76
91
 
77
- return consol_df, asset_detail_df , region_df
92
+ return consol_df, asset_detail_df , asset_class_df, region_df, final_df