diff --git a/app.py b/app.py index 76a6971..97f5562 100644 --- a/app.py +++ b/app.py @@ -114,6 +114,9 @@ def extract(username: str, password: str): if 'GRUPO' not in df.columns: raise KeyError("Column 'GRUPO' not found in the DataFrame") + # Remove decimals from the 'PERIODO' column (if present) + df['PERIODO'] = df['PERIODO'].apply(lambda x: str(x).replace('.0', '') if isinstance(x, (float, int)) else x) + # Convert the DataFrame to JSON json_result = df[df['GRUPO'] != 'Promedio:'].to_json(orient='records')