ASDADSAD
ASD
import pandas aspd
import numpy as np
# Read the excel file if not already loaded
df = pd.read_excel('REPORTE GENERAL(19-02-2025_08-21-26).xlsx', sheet_name='REPORTE GENERAL',
skiprows=2)
# Create age ranges
bins = [14, 24, 59, 64, 90]
labels = ['14-24', '25-59', '60-64', '65-90']
df['age_range'] = pd.cut(df['EDAD'], bins=bins, labels=labels, right=True)
# Count by age range
age_counts = df['age_range'].value_counts().sort_index()
age_percentages = (age_counts / 724 * 100).round(2)
# Create a summary dataframe
summary_df = pd.DataFrame({
'Cantidad': age_counts,
'Porcentaje (%)': age_percentages
})
print("Distribución por rangos de edad:")
print(summary_df)
2.
¿CUÁNTAS PERSONAS HAYEN CADA CATEGORÍA DE APTITUD LABORAL: APTO,
APTO CON RESTRICCIONES, OBSERVADO, NECESITA COMPLETAR ESTUDIOS Y NO
APTO? ADEMÁS, ¿QUÉ PORCENTAJE REPRESENTA CADA CATEGORÍA SOBRE UN
TOTAL DE 724 PACIENTES
• import pandas as pd
# Read the excel file
df = pd.read_excel('REPORTE GENERAL(19-02-2025_08-
21-26).xlsx', sheet_name='REPORTE GENERAL',
skiprows=2)
# Count aptitude categories
aptitude_counts = df['APTITUD'].value_counts()
aptitude_percentages = (aptitude_counts / 724 *
100).round(2)
# Create summary dataframe
summary_df = pd.DataFrame({
'Cantidad': aptitude_counts,
'Porcentaje (%)': aptitude_percentages
})
print("Distribución por categorías de aptitud
laboral:")
print(summary_df)
3.
PARECE QUE HAYUN PROBLEMA CON LA LECTURA DE
LA COLUMNA DE APTITUD. DÉJAME INTENTAR DE
OTRA MANERA
• import pandas as pd
# Read the excel file
df = pd.read_excel('REPORTE
GENERAL(19-02-2025_08-21-
26).xlsx', sheet_name='REPORTE
GENERAL', skiprows=2)
# First, let's see what values we
actually have in the APTITUD
column
print("Valores únicos en la
columna APTITUD:")
print(df['APTITUD'].unique())