Spaces:
Sleeping
Sleeping
Delete multi_program.py
Browse files- multi_program.py +0 -16
multi_program.py
DELETED
|
@@ -1,16 +0,0 @@
|
|
| 1 |
-
from typing import Dict, List
|
| 2 |
-
|
| 3 |
-
def compare_programs(docs: List[dict]) -> Dict[str, Dict[str, int]]:
|
| 4 |
-
matrix: Dict[str, Dict[str, int]] = {}
|
| 5 |
-
|
| 6 |
-
for d in docs:
|
| 7 |
-
agency = d.get("agency", "Unknown")
|
| 8 |
-
year = d.get("date", "")[:4]
|
| 9 |
-
|
| 10 |
-
if not year.isdigit():
|
| 11 |
-
continue
|
| 12 |
-
|
| 13 |
-
matrix.setdefault(agency, {})
|
| 14 |
-
matrix[agency][year] = matrix[agency].get(year, 0) + 1
|
| 15 |
-
|
| 16 |
-
return matrix
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|