Spaces:
Sleeping
Sleeping
cambios
Browse files- analisis.py +3 -2
analisis.py
CHANGED
|
@@ -81,7 +81,7 @@ class AnalizadorDatos:
|
|
| 81 |
"""Genera gráficos para las columnas especificadas"""
|
| 82 |
|
| 83 |
graficos_dir = "/tmp/graficos"
|
| 84 |
-
os.makedirs(
|
| 85 |
|
| 86 |
for col in columnas_analisis:
|
| 87 |
if col not in self.df.columns:
|
|
@@ -99,7 +99,8 @@ class AnalizadorDatos:
|
|
| 99 |
if pd.api.types.is_categorical_dtype(self.df[c])
|
| 100 |
or pd.api.types.is_object_dtype(self.df[c])]
|
| 101 |
if categoricas and len(self.df[categoricas[0]].unique()) <= 10:
|
| 102 |
-
|
|
|
|
| 103 |
if path:
|
| 104 |
self.graficos[f"{col}_by_{categoricas[0]}"] = {'tipo': 'boxplot', 'path': path}
|
| 105 |
else:
|
|
|
|
| 81 |
"""Genera gráficos para las columnas especificadas"""
|
| 82 |
|
| 83 |
graficos_dir = "/tmp/graficos"
|
| 84 |
+
os.makedirs(graficos_dir, exist_ok=True)
|
| 85 |
|
| 86 |
for col in columnas_analisis:
|
| 87 |
if col not in self.df.columns:
|
|
|
|
| 99 |
if pd.api.types.is_categorical_dtype(self.df[c])
|
| 100 |
or pd.api.types.is_object_dtype(self.df[c])]
|
| 101 |
if categoricas and len(self.df[categoricas[0]].unique()) <= 10:
|
| 102 |
+
boxplot_path = os.path.join(graficos_dir, f"{col}_by_{categoricas[0]}.png")
|
| 103 |
+
path = generar_boxplot_r(self.df, col, categoricas[0], boxplot_path)
|
| 104 |
if path:
|
| 105 |
self.graficos[f"{col}_by_{categoricas[0]}"] = {'tipo': 'boxplot', 'path': path}
|
| 106 |
else:
|