Spaces:
Running
Running
Update util/dataframe.py
Browse files- util/dataframe.py +0 -11
util/dataframe.py
CHANGED
|
@@ -37,17 +37,6 @@ def _to_dataframe(items: Any, columns_map: Dict[str, str]) -> pd.DataFrame:
|
|
| 37 |
df = df.reindex(columns=ordered_cols)
|
| 38 |
return df
|
| 39 |
|
| 40 |
-
def _mean_effectiveness(metrics: List[Dict[str, Any]]) -> float:
|
| 41 |
-
if not metrics:
|
| 42 |
-
return 0.0
|
| 43 |
-
scores = []
|
| 44 |
-
for m in metrics:
|
| 45 |
-
s = str(m.get("effectiveness_score", "0/10")).split("/")[0]
|
| 46 |
-
try:
|
| 47 |
-
scores.append(int(s))
|
| 48 |
-
except Exception:
|
| 49 |
-
pass
|
| 50 |
-
return round(sum(scores) / len(scores), 2) if scores else 0.0
|
| 51 |
|
| 52 |
def _search_dataframe(df: pd.DataFrame, query: str) -> pd.DataFrame:
|
| 53 |
if not query or df.empty:
|
|
|
|
| 37 |
df = df.reindex(columns=ordered_cols)
|
| 38 |
return df
|
| 39 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 40 |
|
| 41 |
def _search_dataframe(df: pd.DataFrame, query: str) -> pd.DataFrame:
|
| 42 |
if not query or df.empty:
|