Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ downloads/**
data
venv
.env
.json
Binary file modified app/api/__pycache__/__init__.cpython-312.pyc
Binary file not shown.
Binary file modified app/api/__pycache__/routes.cpython-312.pyc
Binary file not shown.
Binary file modified app/controllers/__pycache__/__init__.cpython-312.pyc
Binary file not shown.
Binary file modified app/controllers/__pycache__/general_controller.cpython-312.pyc
Binary file not shown.
Binary file modified app/controllers/__pycache__/sns_controller.cpython-312.pyc
Binary file not shown.
1 change: 1 addition & 0 deletions app/services/Prueva_J.json
Original file line number Diff line number Diff line change
@@ -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}}
Binary file modified app/services/__pycache__/__init__.cpython-312.pyc
Binary file not shown.
Binary file modified app/services/__pycache__/sns_service.cpython-312.pyc
Binary file not shown.
31 changes: 31 additions & 0 deletions app/services/data_structure.py
Original file line number Diff line number Diff line change
@@ -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")
Binary file modified app/utils/__pycache__/__init__.cpython-312.pyc
Binary file not shown.
Binary file modified app/utils/__pycache__/data.cpython-312.pyc
Binary file not shown.
Binary file modified app/utils/__pycache__/functions.cpython-312.pyc
Binary file not shown.