Skip to content

Commit

Permalink
[DOI-USGS#157] adding examples with no multi-index
Browse files Browse the repository at this point in the history
  • Loading branch information
pkdash committed Aug 30, 2024
1 parent 26bcad1 commit 9ed8729
Show file tree
Hide file tree
Showing 5 changed files with 107 additions and 8 deletions.
19 changes: 18 additions & 1 deletion demos/hydroshare/USGS_dataretrieval_DailyValues_Examples.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,23 @@
"display(dailyMultiSites[0])"
]
},
{
"metadata": {},
"cell_type": "markdown",
"source": "The following example is the same as the previous example but with multi index turned off (multi_index=False)"
},
{
"metadata": {},
"cell_type": "code",
"outputs": [],
"execution_count": null,
"source": [
"dailyMultiSites = nwis.get_dv(sites=[\"01491000\", \"01645000\"], parameterCd=[\"00010\", \"00060\"],\n",
" start=\"2012-01-01\", end=\"2012-06-30\", statCd=[\"00001\",\"00003\"],\n",
" multi_index=False)\n",
"display(dailyMultiSites[0])"
]
},
{
"cell_type": "markdown",
"metadata": {},
Expand Down Expand Up @@ -330,4 +347,4 @@
},
"nbformat": 4,
"nbformat_minor": 1
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,23 @@
"display(data2[0])"
]
},
{
"metadata": {},
"cell_type": "markdown",
"source": "The following example is the same as the previous example but with multi index turned off (multi_index=False)"
},
{
"metadata": {},
"cell_type": "code",
"outputs": [],
"execution_count": null,
"source": [
"site_ids = [\"434400121275801\", \"375907091432201\"]\n",
"data2 = nwis.get_gwlevels(sites=site_ids, multi_index=False)\n",
"print(\"Retrieved \" + str(len(data2[0])) + \" data values.\")\n",
"display(data2[0])"
]
},
{
"cell_type": "markdown",
"metadata": {
Expand Down
23 changes: 16 additions & 7 deletions demos/hydroshare/USGS_dataretrieval_Peaks_Examples.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,22 @@
"print(\"The query URL used to retrieve the data from NWIS was: \" + peak_data[1].url)"
]
},
{
"metadata": {},
"cell_type": "markdown",
"source": "The following example is the same as the previous example but with multi index turned off (multi_index=False)"
},
{
"metadata": {},
"cell_type": "code",
"outputs": [],
"execution_count": null,
"source": [
"site_ids = ['01594440', '040851325']\n",
"peak_data = nwis.get_discharge_peaks(site_ids, multi_index=False)\n",
"print(\"Retrieved \" + str(len(peak_data[0])) + \" data values.\")"
]
},
{
"cell_type": "markdown",
"metadata": {},
Expand Down Expand Up @@ -239,13 +255,6 @@
"data4 = nwis.get_discharge_peaks(stations, start='1953-01-01', end='1960-01-01')\n",
"display(data4[0])"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
Expand Down
17 changes: 17 additions & 0 deletions demos/hydroshare/USGS_dataretrieval_UnitValues_Examples.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,23 @@
"print('Retrieved ' + str(len(discharge_multisite[0])) + ' data values.')\n",
"display(discharge_multisite[0])"
]
},
{
"metadata": {},
"cell_type": "markdown",
"source": "The following example is the same as the previous example but with multi index turned off (multi_index=False)"
},
{
"metadata": {},
"cell_type": "code",
"outputs": [],
"execution_count": null,
"source": [
"discharge_multisite = nwis.get_iv(sites=['04024430', '04024000'], parameterCd=parameterCode,\n",
" start='2013-10-01', end='2013-10-01', multi_index=False)\n",
"print('Retrieved ' + str(len(discharge_multisite[0])) + ' data values.')\n",
"display(discharge_multisite[0])"
]
}
],
"metadata": {
Expand Down
39 changes: 39 additions & 0 deletions demos/hydroshare/USGS_dataretrieval_WaterSamples_Examples.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,24 @@
"display(wq_multi_site[0])"
]
},
{
"metadata": {},
"cell_type": "markdown",
"source": "The following example is the same as the previous example but with multi index turned off (multi_index=False)"
},
{
"metadata": {},
"cell_type": "code",
"outputs": [],
"execution_count": null,
"source": [
"site_ids = ['04024430', '04024000']\n",
"parameter_code = '00065'\n",
"wq_multi_site = nwis.get_qwdata(sites=site_ids, parameterCd=parameter_code, multi_index=False)\n",
"print('Retrieved data for ' + str(len(wq_multi_site[0])) + ' samples.')\n",
"display(wq_multi_site[0])"
]
},
{
"cell_type": "markdown",
"metadata": {
Expand Down Expand Up @@ -260,6 +278,27 @@
"display(wq_data2[0])\n"
]
},
{
"metadata": {},
"cell_type": "markdown",
"source": "The following example is the same as the previous example but with multi index turned off (multi_index=False)"
},
{
"metadata": {},
"cell_type": "code",
"outputs": [],
"execution_count": null,
"source": [
"site_ids = ['04024430', '04024000']\n",
"parameterCd = ['34247', '30234', '32104', '34220']\n",
"startDate = '2012-01-01'\n",
"endDate = ''\n",
"wq_data2 = nwis.get_qwdata(sites=site_ids, parameterCd=parameterCd,\n",
" start=startDate, end=endDate, multi_index=False)\n",
"print('Retrieved data for ' + str(len(wq_multi_site[0])) + ' samples.')\n",
"display(wq_data2[0])"
]
},
{
"cell_type": "markdown",
"metadata": {},
Expand Down

0 comments on commit 9ed8729

Please sign in to comment.