Skip to content

Commit

Permalink
Update list of dicts notebooks (#491)
Browse files Browse the repository at this point in the history
  • Loading branch information
sandorkertesz authored Oct 17, 2024
1 parent 2656f54 commit 0bada95
Showing 1 changed file with 42 additions and 59 deletions.
101 changes: 42 additions & 59 deletions docs/examples/fields_from_dict_in_loop.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,10 @@
"metadata": {},
"outputs": [],
"source": [
"from earthkit.data.sources.array_list import ArrayField\n",
"from earthkit.data.indexing.fieldlist import FieldArray\n",
"from earthkit.data import ArrayField\n",
"from earthkit.data import SimpleFieldList\n",
"\n",
"ds = FieldArray()\n",
"ds = SimpleFieldList()\n",
"for f in d:\n",
" ds.append(ArrayField(f[\"values\"], f))"
]
Expand Down Expand Up @@ -104,7 +104,6 @@
" <th>valid_datetime</th>\n",
" <th>step</th>\n",
" <th>number</th>\n",
" <th>&lt;class 'set'&gt;</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
Expand All @@ -113,8 +112,7 @@
" <td>t</td>\n",
" <td>500</td>\n",
" <td>None</td>\n",
" <td>2018-08-01T09:00:00Z</td>\n",
" <td>None</td>\n",
" <td>2018-08-01T09:00:00+00:00</td>\n",
" <td>None</td>\n",
" <td>None</td>\n",
" </tr>\n",
Expand All @@ -123,8 +121,7 @@
" <td>t</td>\n",
" <td>850</td>\n",
" <td>None</td>\n",
" <td>2018-08-01T09:00:00Z</td>\n",
" <td>None</td>\n",
" <td>2018-08-01T09:00:00+00:00</td>\n",
" <td>None</td>\n",
" <td>None</td>\n",
" </tr>\n",
Expand All @@ -133,8 +130,7 @@
" <td>u</td>\n",
" <td>500</td>\n",
" <td>None</td>\n",
" <td>2018-08-01T09:00:00Z</td>\n",
" <td>None</td>\n",
" <td>2018-08-01T09:00:00+00:00</td>\n",
" <td>None</td>\n",
" <td>None</td>\n",
" </tr>\n",
Expand All @@ -143,8 +139,7 @@
" <td>u</td>\n",
" <td>850</td>\n",
" <td>None</td>\n",
" <td>2018-08-01T09:00:00Z</td>\n",
" <td>None</td>\n",
" <td>2018-08-01T09:00:00+00:00</td>\n",
" <td>None</td>\n",
" <td>None</td>\n",
" </tr>\n",
Expand All @@ -153,8 +148,7 @@
" <td>d</td>\n",
" <td>850</td>\n",
" <td>None</td>\n",
" <td>2018-08-01T09:00:00Z</td>\n",
" <td>None</td>\n",
" <td>2018-08-01T09:00:00+00:00</td>\n",
" <td>None</td>\n",
" <td>None</td>\n",
" </tr>\n",
Expand All @@ -163,8 +157,7 @@
" <td>d</td>\n",
" <td>600</td>\n",
" <td>None</td>\n",
" <td>2018-08-01T09:00:00Z</td>\n",
" <td>None</td>\n",
" <td>2018-08-01T09:00:00+00:00</td>\n",
" <td>None</td>\n",
" <td>None</td>\n",
" </tr>\n",
Expand All @@ -173,13 +166,13 @@
"</div>"
],
"text/plain": [
" param level base_datetime valid_datetime step number <class 'set'>\n",
"0 t 500 None 2018-08-01T09:00:00Z None None None\n",
"1 t 850 None 2018-08-01T09:00:00Z None None None\n",
"2 u 500 None 2018-08-01T09:00:00Z None None None\n",
"3 u 850 None 2018-08-01T09:00:00Z None None None\n",
"4 d 850 None 2018-08-01T09:00:00Z None None None\n",
"5 d 600 None 2018-08-01T09:00:00Z None None None"
" param level base_datetime valid_datetime step number\n",
"0 t 500 None 2018-08-01T09:00:00+00:00 None None\n",
"1 t 850 None 2018-08-01T09:00:00+00:00 None None\n",
"2 u 500 None 2018-08-01T09:00:00+00:00 None None\n",
"3 u 850 None 2018-08-01T09:00:00+00:00 None None\n",
"4 d 850 None 2018-08-01T09:00:00+00:00 None None\n",
"5 d 600 None 2018-08-01T09:00:00+00:00 None None"
]
},
"execution_count": 3,
Expand Down Expand Up @@ -305,7 +298,7 @@
},
{
"cell_type": "code",
"execution_count": 17,
"execution_count": 8,
"id": "e85b74cc-7524-49ea-9c94-9cdbec2e80dc",
"metadata": {},
"outputs": [
Expand All @@ -315,7 +308,7 @@
"datetime.datetime(2018, 8, 1, 9, 0, tzinfo=tzutc())"
]
},
"execution_count": 17,
"execution_count": 8,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -326,7 +319,7 @@
},
{
"cell_type": "code",
"execution_count": 13,
"execution_count": 9,
"id": "f59740a9-e6ce-40bd-a65b-f21a272c51c3",
"metadata": {},
"outputs": [
Expand All @@ -336,7 +329,7 @@
"[20.0, 10.0]"
]
},
"execution_count": 13,
"execution_count": 9,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -347,7 +340,7 @@
},
{
"cell_type": "code",
"execution_count": 14,
"execution_count": 10,
"id": "526a4533-a274-4549-bc08-441ae19ecb5a",
"metadata": {},
"outputs": [
Expand Down Expand Up @@ -378,7 +371,6 @@
" <th>valid_datetime</th>\n",
" <th>step</th>\n",
" <th>number</th>\n",
" <th>&lt;class 'set'&gt;</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
Expand All @@ -387,8 +379,7 @@
" <td>t</td>\n",
" <td>500</td>\n",
" <td>None</td>\n",
" <td>2018-08-01T09:00:00Z</td>\n",
" <td>None</td>\n",
" <td>2018-08-01T09:00:00+00:00</td>\n",
" <td>None</td>\n",
" <td>None</td>\n",
" </tr>\n",
Expand All @@ -397,8 +388,7 @@
" <td>t</td>\n",
" <td>850</td>\n",
" <td>None</td>\n",
" <td>2018-08-01T09:00:00Z</td>\n",
" <td>None</td>\n",
" <td>2018-08-01T09:00:00+00:00</td>\n",
" <td>None</td>\n",
" <td>None</td>\n",
" </tr>\n",
Expand All @@ -407,12 +397,12 @@
"</div>"
],
"text/plain": [
" param level base_datetime valid_datetime step number <class 'set'>\n",
"0 t 500 None 2018-08-01T09:00:00Z None None None\n",
"1 t 850 None 2018-08-01T09:00:00Z None None None"
" param level base_datetime valid_datetime step number\n",
"0 t 500 None 2018-08-01T09:00:00+00:00 None None\n",
"1 t 850 None 2018-08-01T09:00:00+00:00 None None"
]
},
"execution_count": 14,
"execution_count": 10,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -423,7 +413,7 @@
},
{
"cell_type": "code",
"execution_count": 10,
"execution_count": 11,
"id": "1b69116f-7852-4ef9-85b6-51d1c4227da2",
"metadata": {},
"outputs": [
Expand Down Expand Up @@ -454,7 +444,6 @@
" <th>valid_datetime</th>\n",
" <th>step</th>\n",
" <th>number</th>\n",
" <th>&lt;class 'set'&gt;</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
Expand All @@ -463,8 +452,7 @@
" <td>t</td>\n",
" <td>500</td>\n",
" <td>None</td>\n",
" <td>2018-08-01T09:00:00Z</td>\n",
" <td>None</td>\n",
" <td>2018-08-01T09:00:00+00:00</td>\n",
" <td>None</td>\n",
" <td>None</td>\n",
" </tr>\n",
Expand All @@ -473,8 +461,7 @@
" <td>u</td>\n",
" <td>500</td>\n",
" <td>None</td>\n",
" <td>2018-08-01T09:00:00Z</td>\n",
" <td>None</td>\n",
" <td>2018-08-01T09:00:00+00:00</td>\n",
" <td>None</td>\n",
" <td>None</td>\n",
" </tr>\n",
Expand All @@ -483,8 +470,7 @@
" <td>d</td>\n",
" <td>600</td>\n",
" <td>None</td>\n",
" <td>2018-08-01T09:00:00Z</td>\n",
" <td>None</td>\n",
" <td>2018-08-01T09:00:00+00:00</td>\n",
" <td>None</td>\n",
" <td>None</td>\n",
" </tr>\n",
Expand All @@ -493,8 +479,7 @@
" <td>t</td>\n",
" <td>850</td>\n",
" <td>None</td>\n",
" <td>2018-08-01T09:00:00Z</td>\n",
" <td>None</td>\n",
" <td>2018-08-01T09:00:00+00:00</td>\n",
" <td>None</td>\n",
" <td>None</td>\n",
" </tr>\n",
Expand All @@ -503,8 +488,7 @@
" <td>u</td>\n",
" <td>850</td>\n",
" <td>None</td>\n",
" <td>2018-08-01T09:00:00Z</td>\n",
" <td>None</td>\n",
" <td>2018-08-01T09:00:00+00:00</td>\n",
" <td>None</td>\n",
" <td>None</td>\n",
" </tr>\n",
Expand All @@ -513,8 +497,7 @@
" <td>d</td>\n",
" <td>850</td>\n",
" <td>None</td>\n",
" <td>2018-08-01T09:00:00Z</td>\n",
" <td>None</td>\n",
" <td>2018-08-01T09:00:00+00:00</td>\n",
" <td>None</td>\n",
" <td>None</td>\n",
" </tr>\n",
Expand All @@ -523,16 +506,16 @@
"</div>"
],
"text/plain": [
" param level base_datetime valid_datetime step number <class 'set'>\n",
"0 t 500 None 2018-08-01T09:00:00Z None None None\n",
"1 u 500 None 2018-08-01T09:00:00Z None None None\n",
"2 d 600 None 2018-08-01T09:00:00Z None None None\n",
"3 t 850 None 2018-08-01T09:00:00Z None None None\n",
"4 u 850 None 2018-08-01T09:00:00Z None None None\n",
"5 d 850 None 2018-08-01T09:00:00Z None None None"
" param level base_datetime valid_datetime step number\n",
"0 t 500 None 2018-08-01T09:00:00+00:00 None None\n",
"1 u 500 None 2018-08-01T09:00:00+00:00 None None\n",
"2 d 600 None 2018-08-01T09:00:00+00:00 None None\n",
"3 t 850 None 2018-08-01T09:00:00+00:00 None None\n",
"4 u 850 None 2018-08-01T09:00:00+00:00 None None\n",
"5 d 850 None 2018-08-01T09:00:00+00:00 None None"
]
},
"execution_count": 10,
"execution_count": 11,
"metadata": {},
"output_type": "execute_result"
}
Expand Down

0 comments on commit 0bada95

Please sign in to comment.