Pingul commited on
Commit
12c8d1e
·
verified ·
1 Parent(s): 8cc6714

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +17 -0
app.py CHANGED
@@ -226,6 +226,23 @@ async def get_cumulative_exoplanet_by_name(kepoi_name: str):
226
  return ExoplanetCumulative(**data)
227
 
228
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
229
  # ============================================================================
230
  # ENDPOINTS PARA DATASET K2
231
  # ============================================================================
 
226
  return ExoplanetCumulative(**data)
227
 
228
 
229
+ @app.get("/kepler/summary")
230
+ async def get_kepler_summary():
231
+ """
232
+ Devuelve el conteo de exoplanetas confirmados, candidatos, falsos positivos y el total en el dataset Kepler.
233
+ """
234
+ df = load_csv_dataset("cumulative_2025.10.05_10.28.27.csv")
235
+ disposition_counts = df['koi_disposition'].value_counts().to_dict()
236
+ # Normalizar claves
237
+ summary = {
238
+ "CONFIRMED": disposition_counts.get("CONFIRMED", 0),
239
+ "CANDIDATE": disposition_counts.get("CANDIDATE", 0),
240
+ "FALSE POSITIVE": disposition_counts.get("FALSE POSITIVE", 0),
241
+ "TOTAL": int(df.shape[0])
242
+ }
243
+ return summary
244
+
245
+
246
  # ============================================================================
247
  # ENDPOINTS PARA DATASET K2
248
  # ============================================================================