diff --git a/.gitignore b/.gitignore index 917a00c..4e430b2 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ downloads/** data venv .env +.json \ No newline at end of file diff --git a/app/api/__pycache__/__init__.cpython-312.pyc b/app/api/__pycache__/__init__.cpython-312.pyc index 90a7827..fd4c92f 100644 Binary files a/app/api/__pycache__/__init__.cpython-312.pyc and b/app/api/__pycache__/__init__.cpython-312.pyc differ diff --git a/app/api/__pycache__/routes.cpython-312.pyc b/app/api/__pycache__/routes.cpython-312.pyc index 9a17a64..8d6d982 100644 Binary files a/app/api/__pycache__/routes.cpython-312.pyc and b/app/api/__pycache__/routes.cpython-312.pyc differ diff --git a/app/controllers/__pycache__/__init__.cpython-312.pyc b/app/controllers/__pycache__/__init__.cpython-312.pyc index 9ba7798..3c33339 100644 Binary files a/app/controllers/__pycache__/__init__.cpython-312.pyc and b/app/controllers/__pycache__/__init__.cpython-312.pyc differ diff --git a/app/controllers/__pycache__/general_controller.cpython-312.pyc b/app/controllers/__pycache__/general_controller.cpython-312.pyc index 1cac2fb..296e9f0 100644 Binary files a/app/controllers/__pycache__/general_controller.cpython-312.pyc and b/app/controllers/__pycache__/general_controller.cpython-312.pyc differ diff --git a/app/controllers/__pycache__/sns_controller.cpython-312.pyc b/app/controllers/__pycache__/sns_controller.cpython-312.pyc index db94437..ee676ae 100644 Binary files a/app/controllers/__pycache__/sns_controller.cpython-312.pyc and b/app/controllers/__pycache__/sns_controller.cpython-312.pyc differ diff --git a/app/services/Prueva_J.json b/app/services/Prueva_J.json new file mode 100644 index 0000000..ed6e165 --- /dev/null +++ b/app/services/Prueva_J.json @@ -0,0 +1 @@ +{"P\u00e1gina":{"0":"\/herramientas-de-consulta\/volante-de-nomina\/","1":"\/","2":"\/servicios\/pasantia-medica-de-ley\/","3":"\/autoservicios\/","4":"\/transparencia\/recursos-humanos\/nominas-de-empleados\/","5":"\/herramientas-de-consulta\/consulta-de-exequatur\/","6":"\/coronavirus\/establecimientos-toma-muestras-pcr\/","7":"\/foro\/main-forum\/","8":"\/servicios\/solicitud-de-empleo\/","9":"\/servicios\/","10":"\/transparencia\/","11":"\/sobre-nosotros\/quienes-somos\/","12":"\/regionales-de-salud\/","13":"\/regionales-de-salud\/metropolitano\/","14":"\/foro\/main-forum","15":"\/herramientas-de-consulta\/","16":"\/contacto\/","17":"\/servicios\/gestion-de-citas-medicas\/","18":"\/transparencia\/recursos-humanos\/","19":"\/sobre-nosotros\/organigrama\/","20":"Total"},"Vistas de una p\u00e1gina":{"0":96673,"1":36169,"2":28091,"3":22451,"4":18279,"5":16063,"6":11245,"7":9641,"8":6932,"9":6390,"10":5587,"11":4128,"12":3359,"13":2950,"14":2237,"15":2143,"16":2066,"17":1959,"18":1755,"19":1619,"20":390995},"N\u00famero de vistas de p\u00e1gina \u00fanicas":{"0":57460,"1":28188,"2":22575,"3":16639,"4":14497,"5":11747,"6":8565,"7":119,"8":5166,"9":5160,"10":4472,"11":3392,"12":2292,"13":2371,"14":27,"15":1757,"16":1788,"17":1692,"18":1470,"19":1379,"20":282611},"Promedio de tiempo en la p\u00e1gina":{"0":124.3784829892,"1":89.7614803163,"2":153.0671641791,"3":288.1576768394,"4":242.7883386581,"5":191.241555381,"6":171.3318070818,"7":43.3828362114,"8":120.1290801187,"9":46.7227901383,"10":59.5322685085,"11":221.4437317784,"12":70.3712598425,"13":184.6157237325,"14":32.5578568213,"15":31.8299465241,"16":192.8200514139,"17":197.6763392857,"18":51.1227272727,"19":189.6122699387,"20":122.6982238299},"Entradas":{"0":53379,"1":23297,"2":17993,"3":9509,"4":10305,"5":11212,"6":8442,"7":64,"8":4212,"9":813,"10":592,"11":1945,"12":1344,"13":1531,"14":27,"15":150,"16":890,"17":1486,"18":456,"19":439,"20":194167},"Porcentaje de rebote":{"0":0.4166432492,"1":0.408765077,"2":0.6441949647,"3":0.701966558,"4":0.703930131,"5":0.7304913939,"6":0.7353707652,"7":0.1875,"8":0.5880816714,"9":0.405904059,"10":0.3800675676,"11":0.7131105398,"12":0.3333333333,"13":0.6760287394,"14":0.2592592593,"15":0.3933333333,"16":0.7483146067,"17":0.8445491252,"18":0.4539473684,"19":0.7129840547,"20":0.5862243006},"Porcentaje de salidas":{"0":0.5296411614,"1":0.367220548,"2":0.5802214232,"3":0.6234466171,"4":0.6575304995,"5":0.6829981946,"6":0.7086705202,"7":0.0089202365,"8":0.5138488171,"9":0.2192488263,"10":0.170753535,"11":0.5845445736,"12":0.2438225662,"13":0.5386440678,"14":0.0071524363,"15":0.1273915072,"16":0.6234269119,"17":0.7713118938,"18":0.2478632479,"19":0.4966028413,"20":0.4965971432}} \ No newline at end of file diff --git a/app/services/__pycache__/__init__.cpython-312.pyc b/app/services/__pycache__/__init__.cpython-312.pyc index c044c9e..d4a2770 100644 Binary files a/app/services/__pycache__/__init__.cpython-312.pyc and b/app/services/__pycache__/__init__.cpython-312.pyc differ diff --git a/app/services/__pycache__/sns_service.cpython-312.pyc b/app/services/__pycache__/sns_service.cpython-312.pyc index 23781f0..8c2cc84 100644 Binary files a/app/services/__pycache__/sns_service.cpython-312.pyc and b/app/services/__pycache__/sns_service.cpython-312.pyc differ diff --git a/app/services/data_structure.py b/app/services/data_structure.py new file mode 100644 index 0000000..4693c7c --- /dev/null +++ b/app/services/data_structure.py @@ -0,0 +1,31 @@ +# Import the pandas library to work with tabular data +import pandas as pd +# Import the deepcopy function from the copy library to create a deep copy of an object +from copy import deepcopy + +# Definition of the DataStructure class +class DataStructure: + def __init__(self, json_file): + # Initialize the DataStructure object with a JSON file + self.json_file = json_file + # Read the JSON file and convert it into a pandas DataFrame + self.df = pd.read_json(json_file) + + def decribe_df(self): + # Create a deep copy of the DataFrame + data = deepcopy(self.df) + # Return a statistical summary of the DataFrame + return data.describe() + + def info_df(self): + # Create a deep copy of the DataFrame + data = deepcopy(self.df) + # Return information about the DataFrame, such as column data types and the number of non-null values + return data.info() + +# Main execution block of the program +if __name__ == "__main__": + # Create an instance of the DataStructure class with the "Prueva_J.json" JSON file + data_structure = DataStructure("Prueva_J.json") + # Call the decribe_df() method to get a statistical summary of the DataFrame and save it to a JSON file named "name.json" + data_structure.decribe_df().to_json("name") diff --git a/app/utils/__pycache__/__init__.cpython-312.pyc b/app/utils/__pycache__/__init__.cpython-312.pyc index a9f427a..ecd9333 100644 Binary files a/app/utils/__pycache__/__init__.cpython-312.pyc and b/app/utils/__pycache__/__init__.cpython-312.pyc differ diff --git a/app/utils/__pycache__/data.cpython-312.pyc b/app/utils/__pycache__/data.cpython-312.pyc index c959508..c8cbfc1 100644 Binary files a/app/utils/__pycache__/data.cpython-312.pyc and b/app/utils/__pycache__/data.cpython-312.pyc differ diff --git a/app/utils/__pycache__/functions.cpython-312.pyc b/app/utils/__pycache__/functions.cpython-312.pyc index 4539c17..334bb69 100644 Binary files a/app/utils/__pycache__/functions.cpython-312.pyc and b/app/utils/__pycache__/functions.cpython-312.pyc differ