Akram Sanad commited on
Commit
1e9c075
·
1 Parent(s): 98a2104

adding libraries to requirements, creating a visualize notebook to work on plots

Browse files
Files changed (3) hide show
  1. requirements.txt +3 -1
  2. rpg_utils.ipynb +21 -151
  3. visualize.ipynb +31 -0
requirements.txt CHANGED
@@ -14,4 +14,6 @@ nbformat>=4.2.0
14
  pandas
15
  openmeteo_requests
16
  requests_cache
17
- retry_requests
 
 
 
14
  pandas
15
  openmeteo_requests
16
  requests_cache
17
+ retry_requests
18
+ fuzzywuzzy
19
+ plotly
rpg_utils.ipynb CHANGED
@@ -2,9 +2,18 @@
2
  "cells": [
3
  {
4
  "cell_type": "code",
5
- "execution_count": 69,
6
  "metadata": {},
7
- "outputs": [],
 
 
 
 
 
 
 
 
 
8
  "source": [
9
  "import pandas as pd\n",
10
  "from fuzzywuzzy import process\n",
@@ -39,23 +48,7 @@
39
  },
40
  {
41
  "cell_type": "code",
42
- "execution_count": null,
43
- "metadata": {},
44
- "outputs": [],
45
- "source": [
46
- "df = pd.read_csv(\"./data_rpg/data_prepared_rpg.csv\")\n",
47
- "\n",
48
- "pop, sorted_df = get_popular_agriculture(\n",
49
- " df,\n",
50
- " \"Bretagne\",\n",
51
- " 132.5\n",
52
- " \n",
53
- ")"
54
- ]
55
- },
56
- {
57
- "cell_type": "code",
58
- "execution_count": 73,
59
  "metadata": {},
60
  "outputs": [
61
  {
@@ -175,143 +168,20 @@
175
  "104 Autres céréales 5176.17 "
176
  ]
177
  },
178
- "execution_count": 73,
179
- "metadata": {},
180
- "output_type": "execute_result"
181
- }
182
- ],
183
- "source": [
184
- "sorted_df"
185
- ]
186
- },
187
- {
188
- "cell_type": "code",
189
- "execution_count": 71,
190
- "metadata": {},
191
- "outputs": [
192
- {
193
- "data": {
194
- "text/html": [
195
- "<div>\n",
196
- "<style scoped>\n",
197
- " .dataframe tbody tr th:only-of-type {\n",
198
- " vertical-align: middle;\n",
199
- " }\n",
200
- "\n",
201
- " .dataframe tbody tr th {\n",
202
- " vertical-align: top;\n",
203
- " }\n",
204
- "\n",
205
- " .dataframe thead th {\n",
206
- " text-align: right;\n",
207
- " }\n",
208
- "</style>\n",
209
- "<table border=\"1\" class=\"dataframe\">\n",
210
- " <thead>\n",
211
- " <tr style=\"text-align: right;\">\n",
212
- " <th></th>\n",
213
- " <th>LIBELLE_CULTURE</th>\n",
214
- " <th>LIBELLE_GROUPE_CULTURE</th>\n",
215
- " <th>SURF_PARC</th>\n",
216
- " </tr>\n",
217
- " </thead>\n",
218
- " <tbody>\n",
219
- " <tr>\n",
220
- " <th>2</th>\n",
221
- " <td>Plantes aromatiques herbacées non pérennes (&lt; ...</td>\n",
222
- " <td>Autres cultures industrielles</td>\n",
223
- " <td>277.71</td>\n",
224
- " </tr>\n",
225
- " <tr>\n",
226
- " <th>14</th>\n",
227
- " <td>Autre culture pérenne et jachère dans les bana...</td>\n",
228
- " <td>Divers</td>\n",
229
- " <td>5.31</td>\n",
230
- " </tr>\n",
231
- " <tr>\n",
232
- " <th>26</th>\n",
233
- " <td>Autre plante fourragère annuelle (ni légumineu...</td>\n",
234
- " <td>Fourrage</td>\n",
235
- " <td>118.12</td>\n",
236
- " </tr>\n",
237
- " <tr>\n",
238
- " <th>37</th>\n",
239
- " <td>Agrume</td>\n",
240
- " <td>Vergers</td>\n",
241
- " <td>3.18</td>\n",
242
- " </tr>\n",
243
- " <tr>\n",
244
- " <th>49</th>\n",
245
- " <td>Aïl</td>\n",
246
- " <td>Légumes ou fleurs</td>\n",
247
- " <td>49.67</td>\n",
248
- " </tr>\n",
249
- " <tr>\n",
250
- " <th>61</th>\n",
251
- " <td>Plantes médicinales et à parfum non pérennes (...</td>\n",
252
- " <td>Autres cultures industrielles</td>\n",
253
- " <td>29.14</td>\n",
254
- " </tr>\n",
255
- " <tr>\n",
256
- " <th>78</th>\n",
257
- " <td>Plante aromatique pérenne non arbustive ou arb...</td>\n",
258
- " <td>Autres cultures industrielles</td>\n",
259
- " <td>20.14</td>\n",
260
- " </tr>\n",
261
- " <tr>\n",
262
- " <th>91</th>\n",
263
- " <td>Artichaut</td>\n",
264
- " <td>Légumes ou fleurs</td>\n",
265
- " <td>2953.38</td>\n",
266
- " </tr>\n",
267
- " <tr>\n",
268
- " <th>104</th>\n",
269
- " <td>Avoine d’hiver</td>\n",
270
- " <td>Autres céréales</td>\n",
271
- " <td>5176.17</td>\n",
272
- " </tr>\n",
273
- " <tr>\n",
274
- " <th>117</th>\n",
275
- " <td>Avoine de printemps</td>\n",
276
- " <td>Autres céréales</td>\n",
277
- " <td>877.02</td>\n",
278
- " </tr>\n",
279
- " </tbody>\n",
280
- "</table>\n",
281
- "</div>"
282
- ],
283
- "text/plain": [
284
- " LIBELLE_CULTURE \\\n",
285
- "2 Plantes aromatiques herbacées non pérennes (< ... \n",
286
- "14 Autre culture pérenne et jachère dans les bana... \n",
287
- "26 Autre plante fourragère annuelle (ni légumineu... \n",
288
- "37 Agrume \n",
289
- "49 Aïl \n",
290
- "61 Plantes médicinales et à parfum non pérennes (... \n",
291
- "78 Plante aromatique pérenne non arbustive ou arb... \n",
292
- "91 Artichaut \n",
293
- "104 Avoine d’hiver \n",
294
- "117 Avoine de printemps \n",
295
- "\n",
296
- " LIBELLE_GROUPE_CULTURE SURF_PARC \n",
297
- "2 Autres cultures industrielles 277.71 \n",
298
- "14 Divers 5.31 \n",
299
- "26 Fourrage 118.12 \n",
300
- "37 Vergers 3.18 \n",
301
- "49 Légumes ou fleurs 49.67 \n",
302
- "61 Autres cultures industrielles 29.14 \n",
303
- "78 Autres cultures industrielles 20.14 \n",
304
- "91 Légumes ou fleurs 2953.38 \n",
305
- "104 Autres céréales 5176.17 \n",
306
- "117 Autres céréales 877.02 "
307
- ]
308
- },
309
- "execution_count": 71,
310
  "metadata": {},
311
  "output_type": "execute_result"
312
  }
313
  ],
314
  "source": [
 
 
 
 
 
 
 
 
315
  "sorted_df"
316
  ]
317
  }
 
2
  "cells": [
3
  {
4
  "cell_type": "code",
5
+ "execution_count": 2,
6
  "metadata": {},
7
+ "outputs": [
8
+ {
9
+ "name": "stderr",
10
+ "output_type": "stream",
11
+ "text": [
12
+ "/opt/miniconda3/envs/hackathon/lib/python3.13/site-packages/fuzzywuzzy/fuzz.py:11: UserWarning: Using slow pure-python SequenceMatcher. Install python-Levenshtein to remove this warning\n",
13
+ " warnings.warn('Using slow pure-python SequenceMatcher. Install python-Levenshtein to remove this warning')\n"
14
+ ]
15
+ }
16
+ ],
17
  "source": [
18
  "import pandas as pd\n",
19
  "from fuzzywuzzy import process\n",
 
48
  },
49
  {
50
  "cell_type": "code",
51
+ "execution_count": 4,
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
52
  "metadata": {},
53
  "outputs": [
54
  {
 
168
  "104 Autres céréales 5176.17 "
169
  ]
170
  },
171
+ "execution_count": 4,
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
172
  "metadata": {},
173
  "output_type": "execute_result"
174
  }
175
  ],
176
  "source": [
177
+ "df = pd.read_csv(\"./data_rpg/data_prepared_rpg.csv\")\n",
178
+ "\n",
179
+ "pop, sorted_df = get_popular_agriculture(\n",
180
+ " df,\n",
181
+ " \"Bretagne\",\n",
182
+ " 132.5\n",
183
+ " \n",
184
+ ")\n",
185
  "sorted_df"
186
  ]
187
  }
visualize.ipynb ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "cells": [
3
+ {
4
+ "cell_type": "code",
5
+ "execution_count": null,
6
+ "metadata": {},
7
+ "outputs": [],
8
+ "source": [
9
+ "import pandas as pd #stress hydrique and rendement, besoin en eau\n",
10
+ "import plotly.graph_objects as go\n",
11
+ "\n",
12
+ "def visualize_climate():\n",
13
+ " figure = go.Figure()\n",
14
+ " "
15
+ ]
16
+ }
17
+ ],
18
+ "metadata": {
19
+ "kernelspec": {
20
+ "display_name": "hackathon",
21
+ "language": "python",
22
+ "name": "python3"
23
+ },
24
+ "language_info": {
25
+ "name": "python",
26
+ "version": "3.13.2"
27
+ }
28
+ },
29
+ "nbformat": 4,
30
+ "nbformat_minor": 2
31
+ }