backup _backup/scripts 18:14:49
Browse files
_backup/scripts/45_package_ca.py
CHANGED
|
@@ -69,8 +69,8 @@ def main():
|
|
| 69 |
shutil.rmtree(tmp)
|
| 70 |
|
| 71 |
# what-if grid: up to 2,000 random eligible cells per region, aggregated to region and country
|
| 72 |
-
|
| 73 |
-
|
| 74 |
rows = []
|
| 75 |
for mo in MONTHS:
|
| 76 |
for p in PRECIP:
|
|
|
|
| 69 |
shutil.rmtree(tmp)
|
| 70 |
|
| 71 |
# what-if grid: up to 2,000 random eligible cells per region, aggregated to region and country
|
| 72 |
+
shuffled = cells_e.sample(frac=1.0, random_state=0)
|
| 73 |
+
samp = shuffled[shuffled.groupby("region", dropna=False).cumcount() < 2000]
|
| 74 |
rows = []
|
| 75 |
for mo in MONTHS:
|
| 76 |
for p in PRECIP:
|