jscholtz commited on
Commit
9fa5b92
·
1 Parent(s): b46a94b

feat: added the color processor

Browse files
Files changed (2) hide show
  1. .gitignore +3 -1
  2. dev/prep_color.ipynb +655 -0
.gitignore CHANGED
@@ -6,4 +6,6 @@ __pycache__/*
6
  notebooks/*
7
  data/Database_poverta_educativa_beta_exp.csv
8
  app_fab.py
9
- *.ipynb
 
 
 
6
  notebooks/*
7
  data/Database_poverta_educativa_beta_exp.csv
8
  app_fab.py
9
+ #*.ipynb
10
+ development.ipynb
11
+ listings.ipynb
dev/prep_color.ipynb ADDED
@@ -0,0 +1,655 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "cells": [
3
+ {
4
+ "cell_type": "code",
5
+ "execution_count": 24,
6
+ "metadata": {},
7
+ "outputs": [],
8
+ "source": [
9
+ "import pymongo\n",
10
+ "import json\n"
11
+ ]
12
+ },
13
+ {
14
+ "cell_type": "code",
15
+ "execution_count": 25,
16
+ "metadata": {},
17
+ "outputs": [],
18
+ "source": [
19
+ "## First we estsablish the actual elligible names:\n",
20
+ "\n",
21
+ "I0 = json.load(open('../maps/regions_I0.geojson','r'))\n",
22
+ "\n",
23
+ "all_regions = []\n",
24
+ "\n",
25
+ "for feature in I0['features']:\n",
26
+ " all_regions.append(feature['properties']['reg_name'])"
27
+ ]
28
+ },
29
+ {
30
+ "cell_type": "code",
31
+ "execution_count": 26,
32
+ "metadata": {},
33
+ "outputs": [
34
+ {
35
+ "data": {
36
+ "text/plain": [
37
+ "{'Piemonte': 0,\n",
38
+ " \"Valle d'Aosta/Vallée d'Aoste\": 1,\n",
39
+ " 'Liguria': 2,\n",
40
+ " \"Valle d'Aosta\": 1}"
41
+ ]
42
+ },
43
+ "execution_count": 26,
44
+ "metadata": {},
45
+ "output_type": "execute_result"
46
+ }
47
+ ],
48
+ "source": [
49
+ "regions_indexer = {item: index for index, item in enumerate(all_regions)}\n",
50
+ "regions_indexer[\"Valle d'Aosta\"] = 1\n",
51
+ "\n",
52
+ "regions_indexer"
53
+ ]
54
+ },
55
+ {
56
+ "cell_type": "code",
57
+ "execution_count": 27,
58
+ "metadata": {},
59
+ "outputs": [],
60
+ "source": [
61
+ "all_provinces = []\n",
62
+ "\n",
63
+ "for region in ['../maps/provinces_R01.geojson','../maps/provinces_R02.geojson','../maps/provinces_R07.geojson']:\n",
64
+ " R = json.load(open(region,'r'))\n",
65
+ "\n",
66
+ " for feature in R['features']:\n",
67
+ " all_provinces.append(feature['properties']['prov_name'])"
68
+ ]
69
+ },
70
+ {
71
+ "cell_type": "code",
72
+ "execution_count": 28,
73
+ "metadata": {},
74
+ "outputs": [
75
+ {
76
+ "data": {
77
+ "text/plain": [
78
+ "{'Torino': 0,\n",
79
+ " 'Vercelli': 1,\n",
80
+ " 'Novara': 2,\n",
81
+ " 'Cuneo': 3,\n",
82
+ " 'Asti': 4,\n",
83
+ " 'Alessandria': 5,\n",
84
+ " 'Biella': 6,\n",
85
+ " 'Verbano-Cusio-Ossola': 7,\n",
86
+ " \"Valle d'Aosta/Vallée d'Aoste\": 8,\n",
87
+ " 'Imperia': 9,\n",
88
+ " 'Savona': 10,\n",
89
+ " 'Genova': 11,\n",
90
+ " 'La Spezia': 12,\n",
91
+ " 'Aosta': 8}"
92
+ ]
93
+ },
94
+ "execution_count": 28,
95
+ "metadata": {},
96
+ "output_type": "execute_result"
97
+ }
98
+ ],
99
+ "source": [
100
+ "provinces_indexer = {item: index for index, item in enumerate(all_provinces)}\n",
101
+ "provinces_indexer['Aosta'] = 8\n",
102
+ "provinces_indexer"
103
+ ]
104
+ },
105
+ {
106
+ "cell_type": "code",
107
+ "execution_count": 29,
108
+ "metadata": {},
109
+ "outputs": [],
110
+ "source": [
111
+ "all_munis = []\n",
112
+ "\n",
113
+ "muni_files = ['../maps/municipalities_P001.geojson','../maps/municipalities_P002.geojson',\n",
114
+ " '../maps/municipalities_P003.geojson','../maps/municipalities_P004.geojson',\n",
115
+ " '../maps/municipalities_P005.geojson','../maps/municipalities_P006.geojson',\n",
116
+ " '../maps/municipalities_P007.geojson','../maps/municipalities_P008.geojson',\n",
117
+ " '../maps/municipalities_P009.geojson','../maps/municipalities_P010.geojson',\n",
118
+ " '../maps/municipalities_P011.geojson','../maps/municipalities_P096.geojson',\n",
119
+ " '../maps/municipalities_P103.geojson']\n",
120
+ "\n",
121
+ "for province in muni_files:\n",
122
+ " M = json.load(open(province,'r'))\n",
123
+ "\n",
124
+ " for feature in M['features']:\n",
125
+ " all_munis.append(feature['properties']['name'])"
126
+ ]
127
+ },
128
+ {
129
+ "cell_type": "code",
130
+ "execution_count": 30,
131
+ "metadata": {},
132
+ "outputs": [],
133
+ "source": [
134
+ "munis_indexer = {item: index for index, item in enumerate(all_munis)}"
135
+ ]
136
+ },
137
+ {
138
+ "attachments": {},
139
+ "cell_type": "markdown",
140
+ "metadata": {},
141
+ "source": [
142
+ "## Now we get the the presence vectors."
143
+ ]
144
+ },
145
+ {
146
+ "cell_type": "code",
147
+ "execution_count": 31,
148
+ "metadata": {},
149
+ "outputs": [],
150
+ "source": [
151
+ "import toml\n",
152
+ "secrets = toml.load('../.streamlit/secrets.toml')"
153
+ ]
154
+ },
155
+ {
156
+ "cell_type": "code",
157
+ "execution_count": 32,
158
+ "metadata": {},
159
+ "outputs": [],
160
+ "source": [
161
+ "client = pymongo.MongoClient(secrets['mongodb_string'])\n",
162
+ "collection = client['poverta_educativa']['database_mappatura']"
163
+ ]
164
+ },
165
+ {
166
+ "cell_type": "code",
167
+ "execution_count": 33,
168
+ "metadata": {},
169
+ "outputs": [],
170
+ "source": [
171
+ "presence_regioni_strings = {}\n",
172
+ "\n",
173
+ "cursor = collection.find()\n",
174
+ "for entry in cursor:\n",
175
+ " presence_regioni_strings[str(entry['_id'])] = entry['Regioni di intervento']\n",
176
+ "\n",
177
+ "presence_regioni_processed = {key: [item.strip() for item in value.split(';')] if isinstance(value,str) else [] for key, value in presence_regioni_strings.items()}\n",
178
+ "\n",
179
+ "presence_regioni_vector = {key: [0]*len(all_regions) for key in presence_regioni_processed.keys()}\n",
180
+ "\n",
181
+ "for key, value in presence_regioni_processed.items():\n",
182
+ " for item in value:\n",
183
+ " if item in regions_indexer:\n",
184
+ " presence_regioni_vector[key][regions_indexer[item]] += 1"
185
+ ]
186
+ },
187
+ {
188
+ "cell_type": "code",
189
+ "execution_count": 34,
190
+ "metadata": {},
191
+ "outputs": [],
192
+ "source": [
193
+ "import pickle"
194
+ ]
195
+ },
196
+ {
197
+ "cell_type": "code",
198
+ "execution_count": 35,
199
+ "metadata": {},
200
+ "outputs": [],
201
+ "source": [
202
+ "pickle.dump(presence_regioni_vector, open('../data/presence_regioni_vector.pkl', 'wb'))"
203
+ ]
204
+ },
205
+ {
206
+ "cell_type": "code",
207
+ "execution_count": 51,
208
+ "metadata": {},
209
+ "outputs": [],
210
+ "source": [
211
+ "pickle.dump(all_regions, open('../data/all_regions.pkl', 'wb'))\n",
212
+ "pickle.dump(all_provinces, open('../data/all_provinces.pkl', 'wb'))\n",
213
+ "pickle.dump(all_munis, open('../data/all_munis.pkl', 'wb'))"
214
+ ]
215
+ },
216
+ {
217
+ "cell_type": "code",
218
+ "execution_count": 37,
219
+ "metadata": {},
220
+ "outputs": [
221
+ {
222
+ "data": {
223
+ "text/plain": [
224
+ "{'Abruzzo',\n",
225
+ " 'Basilicata',\n",
226
+ " 'Calabria',\n",
227
+ " 'Campania',\n",
228
+ " 'Emilia-Romagna',\n",
229
+ " 'Friuli-Venezia Giulia',\n",
230
+ " 'Lazio',\n",
231
+ " 'Liguria',\n",
232
+ " 'Lombardia',\n",
233
+ " 'Marche',\n",
234
+ " 'Molise',\n",
235
+ " 'Piemonte',\n",
236
+ " 'Puglia',\n",
237
+ " 'Sardegna',\n",
238
+ " 'Sicilia',\n",
239
+ " 'Toscana',\n",
240
+ " 'Trentino-Alto Adige',\n",
241
+ " 'Umbria',\n",
242
+ " \"Valle d'Aosta\",\n",
243
+ " 'Veneto'}"
244
+ ]
245
+ },
246
+ "execution_count": 37,
247
+ "metadata": {},
248
+ "output_type": "execute_result"
249
+ }
250
+ ],
251
+ "source": [
252
+ "all_regions_in = set()\n",
253
+ "\n",
254
+ "for values in presence_regioni_processed.values():\n",
255
+ " for value in values:\n",
256
+ " all_regions_in.add(value)\n",
257
+ "\n",
258
+ "all_regions_in"
259
+ ]
260
+ },
261
+ {
262
+ "cell_type": "code",
263
+ "execution_count": 38,
264
+ "metadata": {},
265
+ "outputs": [],
266
+ "source": [
267
+ "presence_province_strings = {}\n",
268
+ "\n",
269
+ "cursor = collection.find()\n",
270
+ "for entry in cursor:\n",
271
+ " presence_province_strings[str(entry['_id'])] = entry['Province di intervento']\n",
272
+ "\n",
273
+ "presence_province_processed = {key: [item.strip() for item in value.split(';')] if isinstance(value,str) else [] for key, value in presence_province_strings.items()}\n",
274
+ "\n",
275
+ "presence_province_vector = {key: [0]*len(all_provinces) for key in presence_province_processed.keys()}\n",
276
+ "\n",
277
+ "for key, value in presence_province_processed.items():\n",
278
+ " for item in value:\n",
279
+ " if item in provinces_indexer:\n",
280
+ " presence_province_vector[key][provinces_indexer[item]] += 1"
281
+ ]
282
+ },
283
+ {
284
+ "cell_type": "code",
285
+ "execution_count": 39,
286
+ "metadata": {},
287
+ "outputs": [],
288
+ "source": [
289
+ "pickle.dump(presence_province_vector, open('../data/presence_province_vector.pkl', 'wb'))"
290
+ ]
291
+ },
292
+ {
293
+ "cell_type": "code",
294
+ "execution_count": 40,
295
+ "metadata": {},
296
+ "outputs": [
297
+ {
298
+ "data": {
299
+ "text/plain": [
300
+ "{'Agrigento',\n",
301
+ " 'Alessandria',\n",
302
+ " 'Ancona',\n",
303
+ " 'Andria',\n",
304
+ " 'Aosta',\n",
305
+ " 'Arezzo',\n",
306
+ " 'Ascoli Piceno',\n",
307
+ " 'Asti',\n",
308
+ " 'Avellino',\n",
309
+ " 'Bari',\n",
310
+ " 'Benevento',\n",
311
+ " 'Bergamo',\n",
312
+ " 'Biella',\n",
313
+ " 'Bologna',\n",
314
+ " 'Bolzano',\n",
315
+ " 'Brescia',\n",
316
+ " 'Brindisi',\n",
317
+ " 'Cagliari',\n",
318
+ " 'Caltanissetta',\n",
319
+ " 'Campobasso',\n",
320
+ " 'Caserta',\n",
321
+ " 'Catania',\n",
322
+ " 'Catanzaro',\n",
323
+ " 'Chieti',\n",
324
+ " 'Como',\n",
325
+ " 'Cosenza',\n",
326
+ " 'Cremona',\n",
327
+ " 'Crotone',\n",
328
+ " 'Cuneo',\n",
329
+ " 'Enna',\n",
330
+ " 'Ferrara',\n",
331
+ " 'Firenze',\n",
332
+ " 'Foggia',\n",
333
+ " 'Frosinone',\n",
334
+ " 'Genova',\n",
335
+ " 'Grosseto',\n",
336
+ " 'Imperia',\n",
337
+ " \"L'Aquila\",\n",
338
+ " 'La Spezia',\n",
339
+ " 'La spezia',\n",
340
+ " 'Latina',\n",
341
+ " 'Lecce',\n",
342
+ " 'Lecco',\n",
343
+ " 'Livorno',\n",
344
+ " 'Lodi',\n",
345
+ " 'Lucca',\n",
346
+ " 'Macerata',\n",
347
+ " 'Mantova',\n",
348
+ " 'Massa',\n",
349
+ " 'Matera',\n",
350
+ " 'Messina',\n",
351
+ " 'Milano',\n",
352
+ " 'Modena',\n",
353
+ " 'Monza',\n",
354
+ " 'Napoli',\n",
355
+ " 'Novara',\n",
356
+ " 'Nuoro',\n",
357
+ " 'Padova',\n",
358
+ " 'Palermo',\n",
359
+ " 'Pavia',\n",
360
+ " 'Perugia',\n",
361
+ " 'Pesaro',\n",
362
+ " 'Pescara',\n",
363
+ " 'Pisa',\n",
364
+ " 'Pistoia',\n",
365
+ " 'Potenza',\n",
366
+ " 'Prato',\n",
367
+ " 'Ragusa',\n",
368
+ " 'Reggio di Calabria',\n",
369
+ " 'Rieti',\n",
370
+ " 'Rimini',\n",
371
+ " 'Roma',\n",
372
+ " 'Salerno',\n",
373
+ " 'Sassari',\n",
374
+ " 'Savona',\n",
375
+ " 'Siena',\n",
376
+ " 'Siracusa',\n",
377
+ " 'Sondrio',\n",
378
+ " 'Sud Sardegna',\n",
379
+ " 'Taranto',\n",
380
+ " 'Teramo',\n",
381
+ " 'Terni',\n",
382
+ " 'Torino',\n",
383
+ " 'Trapani',\n",
384
+ " 'Trento',\n",
385
+ " 'Treviso',\n",
386
+ " 'Trieste',\n",
387
+ " 'Udine',\n",
388
+ " 'Varese',\n",
389
+ " 'Venezia',\n",
390
+ " 'Verbano-Cusio-Ossola',\n",
391
+ " 'Vercelli',\n",
392
+ " 'Verona',\n",
393
+ " 'Viterbo'}"
394
+ ]
395
+ },
396
+ "execution_count": 40,
397
+ "metadata": {},
398
+ "output_type": "execute_result"
399
+ }
400
+ ],
401
+ "source": [
402
+ "all_provinces_in = set()\n",
403
+ "\n",
404
+ "for values in presence_province_processed.values():\n",
405
+ " for value in values:\n",
406
+ " all_provinces_in.add(value)\n",
407
+ "\n",
408
+ "all_provinces_in"
409
+ ]
410
+ },
411
+ {
412
+ "cell_type": "code",
413
+ "execution_count": 41,
414
+ "metadata": {},
415
+ "outputs": [],
416
+ "source": [
417
+ "presence_muni_strings = {}\n",
418
+ "\n",
419
+ "cursor = collection.find()\n",
420
+ "for entry in cursor:\n",
421
+ " presence_muni_strings[str(entry['_id'])] = entry['Comuni di intervento']\n",
422
+ "\n",
423
+ "presence_muni_processed = {key: [item.strip() for item in value.split(';')] if isinstance(value,str) else [] for key, value in presence_muni_strings.items()}\n",
424
+ "\n",
425
+ "presence_muni_vector = {key: [0]*len(all_munis) for key in presence_muni_processed.keys()}\n",
426
+ "\n",
427
+ "for key, value in presence_muni_processed.items():\n",
428
+ " for item in value:\n",
429
+ " if item in munis_indexer:\n",
430
+ " presence_muni_vector[key][munis_indexer[item]] += 1"
431
+ ]
432
+ },
433
+ {
434
+ "cell_type": "code",
435
+ "execution_count": 43,
436
+ "metadata": {},
437
+ "outputs": [],
438
+ "source": [
439
+ "pickle.dump(presence_muni_vector, open('../data/presence_muni_vector.pkl', 'wb'))"
440
+ ]
441
+ },
442
+ {
443
+ "cell_type": "code",
444
+ "execution_count": 42,
445
+ "metadata": {},
446
+ "outputs": [],
447
+ "source": [
448
+ "import numpy as np"
449
+ ]
450
+ },
451
+ {
452
+ "cell_type": "code",
453
+ "execution_count": 32,
454
+ "metadata": {},
455
+ "outputs": [
456
+ {
457
+ "data": {
458
+ "text/plain": [
459
+ "array([218., 5., 135.])"
460
+ ]
461
+ },
462
+ "execution_count": 32,
463
+ "metadata": {},
464
+ "output_type": "execute_result"
465
+ }
466
+ ],
467
+ "source": [
468
+ "tot_regions = np.zeros(len(all_regions))\n",
469
+ "\n",
470
+ "for key, value in presence_regioni_vector.items():\n",
471
+ " tot_regions += np.array(value)\n",
472
+ "\n",
473
+ "tot_regions"
474
+ ]
475
+ },
476
+ {
477
+ "cell_type": "code",
478
+ "execution_count": 33,
479
+ "metadata": {},
480
+ "outputs": [
481
+ {
482
+ "data": {
483
+ "text/plain": [
484
+ "array([124., 3., 13., 53., 1., 11., 8., 6., 4., 12., 40.,\n",
485
+ " 80., 17.])"
486
+ ]
487
+ },
488
+ "execution_count": 33,
489
+ "metadata": {},
490
+ "output_type": "execute_result"
491
+ }
492
+ ],
493
+ "source": [
494
+ "tot_provinces = np.zeros(len(all_provinces))\n",
495
+ "\n",
496
+ "for key, value in presence_province_vector.items():\n",
497
+ " tot_provinces += np.array(value)\n",
498
+ "\n",
499
+ "tot_provinces"
500
+ ]
501
+ },
502
+ {
503
+ "cell_type": "code",
504
+ "execution_count": 22,
505
+ "metadata": {},
506
+ "outputs": [
507
+ {
508
+ "data": {
509
+ "text/plain": [
510
+ "array([0., 0., 0., ..., 0., 0., 0.])"
511
+ ]
512
+ },
513
+ "execution_count": 22,
514
+ "metadata": {},
515
+ "output_type": "execute_result"
516
+ }
517
+ ],
518
+ "source": [
519
+ "tot_munis = np.zeros(len(all_munis))\n",
520
+ "\n",
521
+ "for key, value in presence_muni_vector.items():\n",
522
+ " tot_munis += np.array(value)\n",
523
+ "\n",
524
+ "tot_munis"
525
+ ]
526
+ },
527
+ {
528
+ "cell_type": "code",
529
+ "execution_count": 23,
530
+ "metadata": {},
531
+ "outputs": [
532
+ {
533
+ "data": {
534
+ "text/plain": [
535
+ "630.0"
536
+ ]
537
+ },
538
+ "execution_count": 23,
539
+ "metadata": {},
540
+ "output_type": "execute_result"
541
+ }
542
+ ],
543
+ "source": [
544
+ "np.sum(tot_munis)"
545
+ ]
546
+ },
547
+ {
548
+ "cell_type": "code",
549
+ "execution_count": 24,
550
+ "metadata": {},
551
+ "outputs": [
552
+ {
553
+ "data": {
554
+ "text/plain": [
555
+ "1487"
556
+ ]
557
+ },
558
+ "execution_count": 24,
559
+ "metadata": {},
560
+ "output_type": "execute_result"
561
+ }
562
+ ],
563
+ "source": [
564
+ "len(tot_munis)"
565
+ ]
566
+ },
567
+ {
568
+ "cell_type": "code",
569
+ "execution_count": 25,
570
+ "metadata": {},
571
+ "outputs": [
572
+ {
573
+ "data": {
574
+ "text/plain": [
575
+ "244"
576
+ ]
577
+ },
578
+ "execution_count": 25,
579
+ "metadata": {},
580
+ "output_type": "execute_result"
581
+ }
582
+ ],
583
+ "source": [
584
+ "np.sum(tot_munis > 0)"
585
+ ]
586
+ },
587
+ {
588
+ "cell_type": "code",
589
+ "execution_count": 26,
590
+ "metadata": {},
591
+ "outputs": [
592
+ {
593
+ "data": {
594
+ "text/plain": [
595
+ "array([ 1., 4., 1., 1., 1., 1., 1., 2., 4., 2., 2., 1., 1.,\n",
596
+ " 2., 4., 1., 1., 5., 2., 1., 2., 5., 1., 2., 4., 2.,\n",
597
+ " 3., 1., 1., 1., 1., 3., 1., 1., 1., 1., 2., 1., 2.,\n",
598
+ " 1., 1., 84., 1., 1., 1., 1., 1., 1., 1., 3., 1., 1.,\n",
599
+ " 2., 1., 1., 1., 1., 1., 1., 1., 2., 2., 7., 1., 1.,\n",
600
+ " 1., 2., 6., 1., 1., 1., 1., 1., 2., 1., 1., 2., 1.,\n",
601
+ " 1., 1., 6., 4., 1., 1., 2., 1., 1., 1., 2., 1., 1.,\n",
602
+ " 3., 3., 1., 1., 11., 1., 5., 1., 1., 1., 1., 1., 1.,\n",
603
+ " 1., 2., 1., 1., 1., 1., 1., 3., 1., 1., 1., 7., 1.,\n",
604
+ " 1., 2., 1., 1., 1., 2., 1., 2., 1., 1., 1., 1., 1.,\n",
605
+ " 1., 1., 4., 1., 1., 4., 1., 1., 1., 2., 1., 2., 2.,\n",
606
+ " 1., 1., 1., 1., 9., 1., 1., 1., 1., 1., 2., 1., 1.,\n",
607
+ " 5., 1., 1., 3., 2., 3., 8., 7., 1., 2., 5., 3., 1.,\n",
608
+ " 1., 1., 2., 1., 4., 2., 5., 2., 4., 1., 2., 2., 8.,\n",
609
+ " 2., 2., 2., 2., 4., 2., 2., 1., 2., 2., 2., 2., 1.,\n",
610
+ " 1., 3., 2., 2., 18., 3., 4., 1., 1., 1., 2., 7., 1.,\n",
611
+ " 1., 1., 1., 1., 3., 1., 1., 69., 3., 1., 1., 2., 1.,\n",
612
+ " 1., 1., 1., 10., 1., 2., 1., 1., 1., 1., 4., 2., 4.,\n",
613
+ " 2., 1., 1., 1., 2., 1., 2., 1., 2., 2.])"
614
+ ]
615
+ },
616
+ "execution_count": 26,
617
+ "metadata": {},
618
+ "output_type": "execute_result"
619
+ }
620
+ ],
621
+ "source": [
622
+ "tot_munis[tot_munis > 0]"
623
+ ]
624
+ },
625
+ {
626
+ "cell_type": "code",
627
+ "execution_count": null,
628
+ "metadata": {},
629
+ "outputs": [],
630
+ "source": []
631
+ }
632
+ ],
633
+ "metadata": {
634
+ "kernelspec": {
635
+ "display_name": "druidtools-8-hbcXZL-py3.10",
636
+ "language": "python",
637
+ "name": "python3"
638
+ },
639
+ "language_info": {
640
+ "codemirror_mode": {
641
+ "name": "ipython",
642
+ "version": 3
643
+ },
644
+ "file_extension": ".py",
645
+ "mimetype": "text/x-python",
646
+ "name": "python",
647
+ "nbconvert_exporter": "python",
648
+ "pygments_lexer": "ipython3",
649
+ "version": "3.10.12"
650
+ },
651
+ "orig_nbformat": 4
652
+ },
653
+ "nbformat": 4,
654
+ "nbformat_minor": 2
655
+ }