wip
Browse files- difference.ipynb +21 -36
- preprocess.ipynb +2 -24
difference.ipynb
CHANGED
@@ -10,39 +10,10 @@
|
|
10 |
},
|
11 |
{
|
12 |
"cell_type": "code",
|
13 |
-
"execution_count":
|
14 |
"id": "e84709ab-1b47-49ee-8cbd-8aa69744b6c3",
|
15 |
"metadata": {},
|
16 |
-
"outputs": [
|
17 |
-
{
|
18 |
-
"data": {
|
19 |
-
"application/vnd.jupyter.widget-view+json": {
|
20 |
-
"model_id": "a4103c257b7b4691a0a86d817390e9ca",
|
21 |
-
"version_major": 2,
|
22 |
-
"version_minor": 0
|
23 |
-
},
|
24 |
-
"text/plain": [
|
25 |
-
"FloatProgress(value=0.0, layout=Layout(width='auto'), style=ProgressStyle(bar_color='black'))"
|
26 |
-
]
|
27 |
-
},
|
28 |
-
"metadata": {},
|
29 |
-
"output_type": "display_data"
|
30 |
-
},
|
31 |
-
{
|
32 |
-
"data": {
|
33 |
-
"application/vnd.jupyter.widget-view+json": {
|
34 |
-
"model_id": "31245f0a73634185b297464775ba4c13",
|
35 |
-
"version_major": 2,
|
36 |
-
"version_minor": 0
|
37 |
-
},
|
38 |
-
"text/plain": [
|
39 |
-
"FloatProgress(value=0.0, layout=Layout(width='auto'), style=ProgressStyle(bar_color='black'))"
|
40 |
-
]
|
41 |
-
},
|
42 |
-
"metadata": {},
|
43 |
-
"output_type": "display_data"
|
44 |
-
}
|
45 |
-
],
|
46 |
"source": [
|
47 |
"import ibis\n",
|
48 |
"from ibis import _\n",
|
@@ -54,11 +25,10 @@
|
|
54 |
" .rename(geom = \"SHAPE\", gid = \"OBJECTID\")\n",
|
55 |
" # .filter(_.UNIT_NAME == \"Angeles National Forest\")\n",
|
56 |
" .filter(_.reGAP < 3) \n",
|
57 |
-
" #.mutate(geom = _.geom.convert(\"epsg:3310\",\"epsg:4326\"))\n",
|
58 |
")\n",
|
59 |
-
"\n",
|
60 |
-
"conn.create_table(\"t1\", tbl.filter(_.Release_Year == 2024))\n",
|
61 |
-
"conn.create_table(\"t2\", tbl.filter(_.Release_Year == 2023))\n",
|
62 |
"\n",
|
63 |
"conn.disconnect()"
|
64 |
]
|
@@ -68,7 +38,22 @@
|
|
68 |
"execution_count": null,
|
69 |
"id": "121c3cad-680c-4f3a-9075-638711ea1634",
|
70 |
"metadata": {},
|
71 |
-
"outputs": [
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
72 |
"source": [
|
73 |
"%%time\n",
|
74 |
"import duckdb\n",
|
|
|
10 |
},
|
11 |
{
|
12 |
"cell_type": "code",
|
13 |
+
"execution_count": null,
|
14 |
"id": "e84709ab-1b47-49ee-8cbd-8aa69744b6c3",
|
15 |
"metadata": {},
|
16 |
+
"outputs": [],
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
17 |
"source": [
|
18 |
"import ibis\n",
|
19 |
"from ibis import _\n",
|
|
|
25 |
" .rename(geom = \"SHAPE\", gid = \"OBJECTID\")\n",
|
26 |
" # .filter(_.UNIT_NAME == \"Angeles National Forest\")\n",
|
27 |
" .filter(_.reGAP < 3) \n",
|
|
|
28 |
")\n",
|
29 |
+
"lvl = \"State\"\n",
|
30 |
+
"conn.create_table(\"t1\", tbl.filter(_.Release_Year == 2024, _.MNG_AG_LEV == lvl), overwrite = True)\n",
|
31 |
+
"conn.create_table(\"t2\", tbl.filter(_.Release_Year == 2023, _.MNG_AG_LEV == lvl), overwrite = True)\n",
|
32 |
"\n",
|
33 |
"conn.disconnect()"
|
34 |
]
|
|
|
38 |
"execution_count": null,
|
39 |
"id": "121c3cad-680c-4f3a-9075-638711ea1634",
|
40 |
"metadata": {},
|
41 |
+
"outputs": [
|
42 |
+
{
|
43 |
+
"data": {
|
44 |
+
"application/vnd.jupyter.widget-view+json": {
|
45 |
+
"model_id": "ba5fb88fdfbc4c43a4df911a9b958cfd",
|
46 |
+
"version_major": 2,
|
47 |
+
"version_minor": 0
|
48 |
+
},
|
49 |
+
"text/plain": [
|
50 |
+
"FloatProgress(value=0.0, layout=Layout(width='auto'), style=ProgressStyle(bar_color='black'))"
|
51 |
+
]
|
52 |
+
},
|
53 |
+
"metadata": {},
|
54 |
+
"output_type": "display_data"
|
55 |
+
}
|
56 |
+
],
|
57 |
"source": [
|
58 |
"%%time\n",
|
59 |
"import duckdb\n",
|
preprocess.ipynb
CHANGED
@@ -5,7 +5,7 @@
|
|
5 |
"id": "4b4adc2a-bf0c-4ace-87be-dbaf90be0125",
|
6 |
"metadata": {},
|
7 |
"source": [
|
8 |
-
"#
|
9 |
]
|
10 |
},
|
11 |
{
|
@@ -98,7 +98,7 @@
|
|
98 |
},
|
99 |
{
|
100 |
"cell_type": "code",
|
101 |
-
"execution_count":
|
102 |
"id": "55afe07c-8681-4308-bbb9-e460f7380f86",
|
103 |
"metadata": {},
|
104 |
"outputs": [],
|
@@ -111,28 +111,6 @@
|
|
111 |
"ca2024 = conn.read_parquet(\"ca2024.parquet\")"
|
112 |
]
|
113 |
},
|
114 |
-
{
|
115 |
-
"cell_type": "code",
|
116 |
-
"execution_count": 5,
|
117 |
-
"id": "9d4cd1c4-288b-4d1c-907c-ca76ccbdb1d6",
|
118 |
-
"metadata": {},
|
119 |
-
"outputs": [
|
120 |
-
{
|
121 |
-
"data": {
|
122 |
-
"text/plain": [
|
123 |
-
"geopandas.geodataframe.GeoDataFrame"
|
124 |
-
]
|
125 |
-
},
|
126 |
-
"execution_count": 5,
|
127 |
-
"metadata": {},
|
128 |
-
"output_type": "execute_result"
|
129 |
-
}
|
130 |
-
],
|
131 |
-
"source": [
|
132 |
-
"gdf = ca2024.execute()\n",
|
133 |
-
"gdf.__class__"
|
134 |
-
]
|
135 |
-
},
|
136 |
{
|
137 |
"cell_type": "markdown",
|
138 |
"id": "ebbb2650-4442-4e54-8467-5e681d6fab9e",
|
|
|
5 |
"id": "4b4adc2a-bf0c-4ace-87be-dbaf90be0125",
|
6 |
"metadata": {},
|
7 |
"source": [
|
8 |
+
"# Pre-processing"
|
9 |
]
|
10 |
},
|
11 |
{
|
|
|
98 |
},
|
99 |
{
|
100 |
"cell_type": "code",
|
101 |
+
"execution_count": 1,
|
102 |
"id": "55afe07c-8681-4308-bbb9-e460f7380f86",
|
103 |
"metadata": {},
|
104 |
"outputs": [],
|
|
|
111 |
"ca2024 = conn.read_parquet(\"ca2024.parquet\")"
|
112 |
]
|
113 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
114 |
{
|
115 |
"cell_type": "markdown",
|
116 |
"id": "ebbb2650-4442-4e54-8467-5e681d6fab9e",
|