Skip to content

Commit 6711fd9

Browse files
committed
docs: update notebooks to match updates on epidatr/pull/324
1 parent c00a23a commit 6711fd9

File tree

3 files changed

+618
-4
lines changed

3 files changed

+618
-4
lines changed

docs/getting_started.ipynb

Lines changed: 61 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,65 @@
181181
").df()"
182182
]
183183
},
184+
{
185+
"cell_type": "markdown",
186+
"metadata": {},
187+
"source": [
188+
"We can also request all versions of the data issued within a specific time range using the `issues` argument. `issues` can also take a single date.\n"
189+
]
190+
},
191+
{
192+
"cell_type": "code",
193+
"execution_count": null,
194+
"metadata": {},
195+
"outputs": [],
196+
"source": [
197+
"# See how the estimate for a SINGLE day (March 1, 2021) evolved\n",
198+
"# by fetching all issues reported between March and April 2021.\n",
199+
"epidata.pub_covidcast(\n",
200+
" data_source=\"fb-survey\",\n",
201+
" signals=\"smoothed_cli\",\n",
202+
" geo_type=\"state\",\n",
203+
" time_type=\"day\",\n",
204+
" geo_values=\"pa\",\n",
205+
" time_values=\"2021-03-01\",\n",
206+
" issues=EpiRange(\"2021-03-01\", \"2021-04-30\"),\n",
207+
").df()"
208+
]
209+
},
210+
{
211+
"cell_type": "markdown",
212+
"metadata": {},
213+
"source": [
214+
"Finally, we can use the `lag` argument to request only data that was reported a certain number of days after the event.\n"
215+
]
216+
},
217+
{
218+
"cell_type": "code",
219+
"execution_count": null,
220+
"metadata": {},
221+
"outputs": [],
222+
"source": [
223+
"# Fetch survey data for January 2021, but ONLY include data\n",
224+
"# that was issued exactly 2 days after it was collected.\n",
225+
"epidata.pub_covidcast(\n",
226+
" data_source=\"fb-survey\",\n",
227+
" signals=\"smoothed_cli\",\n",
228+
" geo_type=\"state\",\n",
229+
" time_type=\"day\",\n",
230+
" geo_values=\"pa\",\n",
231+
" time_values=EpiRange(20210101, 20210131),\n",
232+
" lag=2,\n",
233+
").df()"
234+
]
235+
},
236+
{
237+
"cell_type": "markdown",
238+
"metadata": {},
239+
"source": [
240+
"See detail notebook about [versioned data](versioned_data.ipynb) for details and more ways to specify versioned data.\n"
241+
]
242+
},
184243
{
185244
"cell_type": "markdown",
186245
"metadata": {},
@@ -234,9 +293,9 @@
234293
"\n",
235294
"Most data is only available for the US. Select endpoints report other countries at the national and/or regional levels. Endpoint descriptions explicitly state when they cover non-US locations.\n",
236295
"\n",
237-
"For endpoints that report US data, see the\n",
296+
"For the main endpoints that report US data, see the\n",
238297
"[geographic coding documentation](https://cmu-delphi.github.io/delphi-epidata/api/covidcast_geography.html)\n",
239-
"for available geographic levels.\n",
298+
"for available geographic levels. Documentation for the other endpoints is available [here](https://cmu-delphi.github.io/delphi-epidata/api/geographic_codes.html).\n",
240299
"\n",
241300
"## International data\n",
242301
"\n",

0 commit comments

Comments
 (0)