diff --git a/.buildinfo b/.buildinfo index 3234f26..d794abe 100644 --- a/.buildinfo +++ b/.buildinfo @@ -1,4 +1,4 @@ # Sphinx build info version 1 # This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done. -config: d1a812aa4fc5d2a936e7f08eb4fd2f4a +config: e433821e94cede3a1e26616fe9095f71 tags: 645f666f9bcd5a90fca523b33c5a78b7 diff --git a/_images/examples_USGS_dataretrieval_GroundwaterLevels_Examples_16_1.png b/_images/examples_USGS_dataretrieval_GroundwaterLevels_Examples_16_1.png index 0a77bd0..ffeaa10 100644 Binary files a/_images/examples_USGS_dataretrieval_GroundwaterLevels_Examples_16_1.png and b/_images/examples_USGS_dataretrieval_GroundwaterLevels_Examples_16_1.png differ diff --git a/_modules/dataretrieval/nadp.html b/_modules/dataretrieval/nadp.html index be27965..fad5f67 100644 --- a/_modules/dataretrieval/nadp.html +++ b/_modules/dataretrieval/nadp.html @@ -3,7 +3,7 @@
-
PARAMCODES_URL = 'https://help.waterdata.usgs.gov/code/parameter_cd_nm_query?'
ALLPARAMCODES_URL = 'https://help.waterdata.usgs.gov/code/parameter_cd_query?'
-WATERSERVICES_SERVICES = ['dv', 'iv', 'site', 'stat', 'gwlevels']
+WATERSERVICES_SERVICES = ['dv', 'iv', 'site', 'stat']
WATERDATA_SERVICES = [
'qwdata',
+ 'gwlevels',
'measurements',
'peaks',
'pmcodes',
@@ -532,12 +533,23 @@ Source code for dataretrieval.nwis
"""
_check_sites_value_types(sites)
- kwargs['startDT'] = kwargs.pop('startDT', start)
- kwargs['endDT'] = kwargs.pop('endDT', end)
- kwargs['sites'] = kwargs.pop('sites', sites)
+ # Make kwargs backwards compatible with waterservices
+ # vocabulary
+ if 'startDT' in kwargs:
+ kwargs['begin_date'] = kwargs.pop('startDT')
+ if 'endDT' in kwargs:
+ kwargs['end_date'] = kwargs.pop('endDT')
+ if 'sites' in kwargs:
+ kwargs['site_no'] = kwargs.pop('sites')
+ if 'stateCd'in kwargs:
+ kwargs['state_cd'] = kwargs.pop('stateCd')
+
+ kwargs['begin_date'] = kwargs.pop('begin_date', start)
+ kwargs['end_date'] = kwargs.pop('end_date', end)
+ kwargs['site_no'] = kwargs.pop('site_no', sites)
kwargs['multi_index'] = multi_index
- response = query_waterservices('gwlevels', ssl_check=ssl_check, **kwargs)
+ response = query_waterdata('gwlevels', format = 'rdb', ssl_check=ssl_check, **kwargs)
df = _read_rdb(response.text)
diff --git a/_modules/dataretrieval/streamstats.html b/_modules/dataretrieval/streamstats.html
index aa380ca..220011c 100644
--- a/_modules/dataretrieval/streamstats.html
+++ b/_modules/dataretrieval/streamstats.html
@@ -3,7 +3,7 @@
- dataretrieval.streamstats — dataretrieval 0.1.dev1+g64a575d documentation
+ dataretrieval.streamstats — dataretrieval 0.1.dev1+gd3865a2 documentation
@@ -14,7 +14,7 @@
-
+
diff --git a/_modules/dataretrieval/utils.html b/_modules/dataretrieval/utils.html
index 64e44e3..035cbe4 100644
--- a/_modules/dataretrieval/utils.html
+++ b/_modules/dataretrieval/utils.html
@@ -3,7 +3,7 @@
- dataretrieval.utils — dataretrieval 0.1.dev1+g64a575d documentation
+ dataretrieval.utils — dataretrieval 0.1.dev1+gd3865a2 documentation
@@ -14,7 +14,7 @@
-
+
diff --git a/_modules/dataretrieval/wqp.html b/_modules/dataretrieval/wqp.html
index c0ece7e..6654047 100644
--- a/_modules/dataretrieval/wqp.html
+++ b/_modules/dataretrieval/wqp.html
@@ -3,7 +3,7 @@
- dataretrieval.wqp — dataretrieval 0.1.dev1+g64a575d documentation
+ dataretrieval.wqp — dataretrieval 0.1.dev1+gd3865a2 documentation
@@ -14,7 +14,7 @@
-
+
diff --git a/_modules/index.html b/_modules/index.html
index 9ccfa91..589456e 100644
--- a/_modules/index.html
+++ b/_modules/index.html
@@ -3,7 +3,7 @@
- Overview: module code — dataretrieval 0.1.dev1+g64a575d documentation
+ Overview: module code — dataretrieval 0.1.dev1+gd3865a2 documentation
@@ -14,7 +14,7 @@
-
+
diff --git a/_static/documentation_options.js b/_static/documentation_options.js
index f6917d4..6fc38cd 100644
--- a/_static/documentation_options.js
+++ b/_static/documentation_options.js
@@ -1,5 +1,5 @@
const DOCUMENTATION_OPTIONS = {
- VERSION: '0.1.dev1+g64a575d',
+ VERSION: '0.1.dev1+gd3865a2',
LANGUAGE: 'en',
COLLAPSE_INDEX: false,
BUILDER: 'html',
diff --git a/examples/USGS_dataretrieval_DailyValues_Examples.html b/examples/USGS_dataretrieval_DailyValues_Examples.html
index e73de01..790b3c3 100644
--- a/examples/USGS_dataretrieval_DailyValues_Examples.html
+++ b/examples/USGS_dataretrieval_DailyValues_Examples.html
@@ -4,7 +4,7 @@
- USGS dataretrieval Python Package get_dv() Examples — dataretrieval 0.1.dev1+g64a575d documentation
+ USGS dataretrieval Python Package get_dv() Examples — dataretrieval 0.1.dev1+gd3865a2 documentation
@@ -16,7 +16,7 @@
-
+
@@ -129,10 +129,10 @@ Install the Package
Defaulting to user installation because normal site-packages is not writeable
-Requirement already satisfied: dataretrieval in /home/runner/.local/lib/python3.10/site-packages (0.1.dev1+g64a575d)
+Requirement already satisfied: dataretrieval in /home/runner/.local/lib/python3.10/site-packages (0.1.dev1+gd3865a2)
Requirement already satisfied: requests in /home/runner/.local/lib/python3.10/site-packages (from dataretrieval) (2.32.3)
Requirement already satisfied: pandas==2.* in /home/runner/.local/lib/python3.10/site-packages (from dataretrieval) (2.2.2)
-Requirement already satisfied: numpy>=1.22.4 in /home/runner/.local/lib/python3.10/site-packages (from pandas==2.*->dataretrieval) (2.0.0)
+Requirement already satisfied: numpy>=1.22.4 in /home/runner/.local/lib/python3.10/site-packages (from pandas==2.*->dataretrieval) (2.0.1)
Requirement already satisfied: python-dateutil>=2.8.2 in /home/runner/.local/lib/python3.10/site-packages (from pandas==2.*->dataretrieval) (2.9.0.post0)
Requirement already satisfied: pytz>=2020.1 in /usr/lib/python3/dist-packages (from pandas==2.*->dataretrieval) (2022.1)
Requirement already satisfied: tzdata>=2022.7 in /home/runner/.local/lib/python3.10/site-packages (from pandas==2.*->dataretrieval) (2024.1)
diff --git a/examples/USGS_dataretrieval_DailyValues_Examples.ipynb b/examples/USGS_dataretrieval_DailyValues_Examples.ipynb
index 4e9386c..8b162e2 100644
--- a/examples/USGS_dataretrieval_DailyValues_Examples.ipynb
+++ b/examples/USGS_dataretrieval_DailyValues_Examples.ipynb
@@ -23,10 +23,10 @@
"execution_count": 1,
"metadata": {
"execution": {
- "iopub.execute_input": "2024-07-19T16:00:09.172976Z",
- "iopub.status.busy": "2024-07-19T16:00:09.172563Z",
- "iopub.status.idle": "2024-07-19T16:00:09.877615Z",
- "shell.execute_reply": "2024-07-19T16:00:09.876877Z"
+ "iopub.execute_input": "2024-08-02T00:48:17.042734Z",
+ "iopub.status.busy": "2024-08-02T00:48:17.042556Z",
+ "iopub.status.idle": "2024-08-02T00:48:17.774766Z",
+ "shell.execute_reply": "2024-08-02T00:48:17.774121Z"
},
"pycharm": {
"is_executing": true,
@@ -45,16 +45,16 @@
"name": "stdout",
"output_type": "stream",
"text": [
- "Requirement already satisfied: dataretrieval in /home/runner/.local/lib/python3.10/site-packages (0.1.dev1+g64a575d)\r\n",
+ "Requirement already satisfied: dataretrieval in /home/runner/.local/lib/python3.10/site-packages (0.1.dev1+gd3865a2)\r\n",
"Requirement already satisfied: requests in /home/runner/.local/lib/python3.10/site-packages (from dataretrieval) (2.32.3)\r\n",
- "Requirement already satisfied: pandas==2.* in /home/runner/.local/lib/python3.10/site-packages (from dataretrieval) (2.2.2)\r\n",
- "Requirement already satisfied: numpy>=1.22.4 in /home/runner/.local/lib/python3.10/site-packages (from pandas==2.*->dataretrieval) (2.0.0)\r\n"
+ "Requirement already satisfied: pandas==2.* in /home/runner/.local/lib/python3.10/site-packages (from dataretrieval) (2.2.2)\r\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
+ "Requirement already satisfied: numpy>=1.22.4 in /home/runner/.local/lib/python3.10/site-packages (from pandas==2.*->dataretrieval) (2.0.1)\r\n",
"Requirement already satisfied: python-dateutil>=2.8.2 in /home/runner/.local/lib/python3.10/site-packages (from pandas==2.*->dataretrieval) (2.9.0.post0)\r\n",
"Requirement already satisfied: pytz>=2020.1 in /usr/lib/python3/dist-packages (from pandas==2.*->dataretrieval) (2022.1)\r\n",
"Requirement already satisfied: tzdata>=2022.7 in /home/runner/.local/lib/python3.10/site-packages (from pandas==2.*->dataretrieval) (2024.1)\r\n",
@@ -82,10 +82,10 @@
"execution_count": 2,
"metadata": {
"execution": {
- "iopub.execute_input": "2024-07-19T16:00:09.880819Z",
- "iopub.status.busy": "2024-07-19T16:00:09.880607Z",
- "iopub.status.idle": "2024-07-19T16:00:10.180113Z",
- "shell.execute_reply": "2024-07-19T16:00:10.179392Z"
+ "iopub.execute_input": "2024-08-02T00:48:17.777690Z",
+ "iopub.status.busy": "2024-08-02T00:48:17.777253Z",
+ "iopub.status.idle": "2024-08-02T00:48:18.064942Z",
+ "shell.execute_reply": "2024-08-02T00:48:18.064406Z"
},
"pycharm": {
"name": "#%%\n"
@@ -131,10 +131,10 @@
"execution_count": 3,
"metadata": {
"execution": {
- "iopub.execute_input": "2024-07-19T16:00:10.183674Z",
- "iopub.status.busy": "2024-07-19T16:00:10.183360Z",
- "iopub.status.idle": "2024-07-19T16:00:10.339774Z",
- "shell.execute_reply": "2024-07-19T16:00:10.339134Z"
+ "iopub.execute_input": "2024-08-02T00:48:18.067662Z",
+ "iopub.status.busy": "2024-08-02T00:48:18.067253Z",
+ "iopub.status.idle": "2024-08-02T00:48:18.575195Z",
+ "shell.execute_reply": "2024-08-02T00:48:18.574685Z"
},
"pycharm": {
"name": "#%%\n"
@@ -177,10 +177,10 @@
"execution_count": 4,
"metadata": {
"execution": {
- "iopub.execute_input": "2024-07-19T16:00:10.342369Z",
- "iopub.status.busy": "2024-07-19T16:00:10.341872Z",
- "iopub.status.idle": "2024-07-19T16:00:10.351881Z",
- "shell.execute_reply": "2024-07-19T16:00:10.351333Z"
+ "iopub.execute_input": "2024-08-02T00:48:18.577406Z",
+ "iopub.status.busy": "2024-08-02T00:48:18.577054Z",
+ "iopub.status.idle": "2024-08-02T00:48:18.586387Z",
+ "shell.execute_reply": "2024-08-02T00:48:18.585935Z"
},
"pycharm": {
"name": "#%%\n"
@@ -336,10 +336,10 @@
"metadata": {
"collapsed": false,
"execution": {
- "iopub.execute_input": "2024-07-19T16:00:10.354178Z",
- "iopub.status.busy": "2024-07-19T16:00:10.353860Z",
- "iopub.status.idle": "2024-07-19T16:00:10.357418Z",
- "shell.execute_reply": "2024-07-19T16:00:10.356896Z"
+ "iopub.execute_input": "2024-08-02T00:48:18.588540Z",
+ "iopub.status.busy": "2024-08-02T00:48:18.588195Z",
+ "iopub.status.idle": "2024-08-02T00:48:18.591396Z",
+ "shell.execute_reply": "2024-08-02T00:48:18.590864Z"
},
"pycharm": {
"name": "#%%\n"
@@ -378,10 +378,10 @@
"metadata": {
"collapsed": false,
"execution": {
- "iopub.execute_input": "2024-07-19T16:00:10.359549Z",
- "iopub.status.busy": "2024-07-19T16:00:10.359202Z",
- "iopub.status.idle": "2024-07-19T16:00:10.366365Z",
- "shell.execute_reply": "2024-07-19T16:00:10.365907Z"
+ "iopub.execute_input": "2024-08-02T00:48:18.593506Z",
+ "iopub.status.busy": "2024-08-02T00:48:18.593164Z",
+ "iopub.status.idle": "2024-08-02T00:48:18.600001Z",
+ "shell.execute_reply": "2024-08-02T00:48:18.599516Z"
},
"pycharm": {
"name": "#%%\n"
@@ -487,10 +487,10 @@
"metadata": {
"collapsed": false,
"execution": {
- "iopub.execute_input": "2024-07-19T16:00:10.368625Z",
- "iopub.status.busy": "2024-07-19T16:00:10.368155Z",
- "iopub.status.idle": "2024-07-19T16:00:10.934790Z",
- "shell.execute_reply": "2024-07-19T16:00:10.934145Z"
+ "iopub.execute_input": "2024-08-02T00:48:18.602083Z",
+ "iopub.status.busy": "2024-08-02T00:48:18.601697Z",
+ "iopub.status.idle": "2024-08-02T00:48:19.149825Z",
+ "shell.execute_reply": "2024-08-02T00:48:19.149192Z"
},
"pycharm": {
"name": "#%%\n"
@@ -536,10 +536,10 @@
"execution_count": 8,
"metadata": {
"execution": {
- "iopub.execute_input": "2024-07-19T16:00:10.937340Z",
- "iopub.status.busy": "2024-07-19T16:00:10.936893Z",
- "iopub.status.idle": "2024-07-19T16:00:10.940186Z",
- "shell.execute_reply": "2024-07-19T16:00:10.939617Z"
+ "iopub.execute_input": "2024-08-02T00:48:19.152276Z",
+ "iopub.status.busy": "2024-08-02T00:48:19.151929Z",
+ "iopub.status.idle": "2024-08-02T00:48:19.155294Z",
+ "shell.execute_reply": "2024-08-02T00:48:19.154728Z"
},
"pycharm": {
"name": "#%%\n"
@@ -584,10 +584,10 @@
"execution_count": 9,
"metadata": {
"execution": {
- "iopub.execute_input": "2024-07-19T16:00:10.942433Z",
- "iopub.status.busy": "2024-07-19T16:00:10.942003Z",
- "iopub.status.idle": "2024-07-19T16:00:11.115886Z",
- "shell.execute_reply": "2024-07-19T16:00:11.115253Z"
+ "iopub.execute_input": "2024-08-02T00:48:19.157612Z",
+ "iopub.status.busy": "2024-08-02T00:48:19.157204Z",
+ "iopub.status.idle": "2024-08-02T00:48:19.329694Z",
+ "shell.execute_reply": "2024-08-02T00:48:19.329183Z"
},
"pycharm": {
"name": "#%%\n"
@@ -806,10 +806,10 @@
"execution_count": 10,
"metadata": {
"execution": {
- "iopub.execute_input": "2024-07-19T16:00:11.118266Z",
- "iopub.status.busy": "2024-07-19T16:00:11.117888Z",
- "iopub.status.idle": "2024-07-19T16:00:11.494604Z",
- "shell.execute_reply": "2024-07-19T16:00:11.493940Z"
+ "iopub.execute_input": "2024-08-02T00:48:19.331994Z",
+ "iopub.status.busy": "2024-08-02T00:48:19.331609Z",
+ "iopub.status.idle": "2024-08-02T00:48:19.526667Z",
+ "shell.execute_reply": "2024-08-02T00:48:19.526156Z"
},
"pycharm": {
"name": "#%%\n"
@@ -1060,10 +1060,10 @@
"execution_count": 11,
"metadata": {
"execution": {
- "iopub.execute_input": "2024-07-19T16:00:11.497307Z",
- "iopub.status.busy": "2024-07-19T16:00:11.496885Z",
- "iopub.status.idle": "2024-07-19T16:00:11.633755Z",
- "shell.execute_reply": "2024-07-19T16:00:11.633127Z"
+ "iopub.execute_input": "2024-08-02T00:48:19.528903Z",
+ "iopub.status.busy": "2024-08-02T00:48:19.528540Z",
+ "iopub.status.idle": "2024-08-02T00:48:19.971285Z",
+ "shell.execute_reply": "2024-08-02T00:48:19.970785Z"
},
"pycharm": {
"name": "#%%\n"
diff --git a/examples/USGS_dataretrieval_GroundwaterLevels_Examples.html b/examples/USGS_dataretrieval_GroundwaterLevels_Examples.html
index 84eeddb..b8b84e3 100644
--- a/examples/USGS_dataretrieval_GroundwaterLevels_Examples.html
+++ b/examples/USGS_dataretrieval_GroundwaterLevels_Examples.html
@@ -4,7 +4,7 @@
- USGS dataretrieval Python Package get_gwlevels() Examples — dataretrieval 0.1.dev1+g64a575d documentation
+ USGS dataretrieval Python Package get_gwlevels() Examples — dataretrieval 0.1.dev1+gd3865a2 documentation
@@ -16,7 +16,7 @@
-
+
@@ -129,10 +129,10 @@ Install the Package
Defaulting to user installation because normal site-packages is not writeable
-Requirement already satisfied: dataretrieval in /home/runner/.local/lib/python3.10/site-packages (0.1.dev1+g64a575d)
+Requirement already satisfied: dataretrieval in /home/runner/.local/lib/python3.10/site-packages (0.1.dev1+gd3865a2)
Requirement already satisfied: requests in /home/runner/.local/lib/python3.10/site-packages (from dataretrieval) (2.32.3)
Requirement already satisfied: pandas==2.* in /home/runner/.local/lib/python3.10/site-packages (from dataretrieval) (2.2.2)
-Requirement already satisfied: numpy>=1.22.4 in /home/runner/.local/lib/python3.10/site-packages (from pandas==2.*->dataretrieval) (2.0.0)
+Requirement already satisfied: numpy>=1.22.4 in /home/runner/.local/lib/python3.10/site-packages (from pandas==2.*->dataretrieval) (2.0.1)
Requirement already satisfied: python-dateutil>=2.8.2 in /home/runner/.local/lib/python3.10/site-packages (from pandas==2.*->dataretrieval) (2.9.0.post0)
Requirement already satisfied: pytz>=2020.1 in /usr/lib/python3/dist-packages (from pandas==2.*->dataretrieval) (2022.1)
Requirement already satisfied: tzdata>=2022.7 in /home/runner/.local/lib/python3.10/site-packages (from pandas==2.*->dataretrieval) (2024.1)
@@ -182,7 +182,7 @@ Basic Usage
-Retrieved 248 data values.
+Retrieved 744 data values.
@@ -246,6 +246,7 @@ Interpreting the Resultlev_src_cd
lev_meth_cd
lev_age_cd
+ parameter_cd
datetime
@@ -265,6 +266,7 @@ Interpreting the Result
+
@@ -276,9 +278,9 @@ Interpreting the Result1945-10-12
22:35
+0000
- 27.35
- NaN
NaN
+ 4192.65
+ NGVD29
1
USGS
m
@@ -286,35 +288,37 @@ Interpreting the ResultS
O
A
+ 62610
- 1999-06-04 18:00:00+00:00
+ 1945-10-12 22:35:00+00:00
USGS
434400121275801
GW
- 1999-06-04
- 18:00
+ 1945-10-12
+ 22:35
+0000
- 16.78
- NaN
NaN
+ 4196.67
+ NAVD88
1
USGS
m
2
S
- S
+ O
A
+ 62611
- 1999-08-19 17:25:00+00:00
+ 1945-10-12 22:35:00+00:00
USGS
434400121275801
GW
- 1999-08-19
- 17:25
+ 1945-10-12
+ 22:35
+0000
- 15.06
+ 27.35
NaN
NaN
1
@@ -322,20 +326,21 @@ Interpreting the Resultm
2
S
- V
+ O
A
+ 72019
- 1999-11-19 18:40:00+00:00
+ 1999-06-04 18:00:00+00:00
USGS
434400121275801
GW
- 1999-11-19
- 18:40
+ 1999-06-04
+ 18:00
+0000
- 17.62
- NaN
NaN
+ 4203.22
+ NGVD29
1
USGS
m
@@ -343,18 +348,19 @@ Interpreting the ResultS
S
A
+ 62610
- 2000-02-11 17:25:00+00:00
+ 1999-06-04 18:00:00+00:00
USGS
434400121275801
GW
- 2000-02-11
- 17:25
+ 1999-06-04
+ 18:00
+0000
- 21.00
- NaN
NaN
+ 4207.24
+ NAVD88
1
USGS
m
@@ -362,6 +368,7 @@ Interpreting the ResultS
S
A
+ 62611
...
@@ -381,18 +388,19 @@ Interpreting the Result...
...
...
+ ...
NaT
USGS
434400121275801
GW
- 1998-09-25
+ 1999-03-19
NaN
- +0000
- 17.36
NaN
NaN
+ 4204.97
+ NAVD88
1
NaN
D
@@ -400,37 +408,39 @@ Interpreting the ResultNaN
S
A
+ 62611
NaT
USGS
434400121275801
GW
- 1998-11-19
+ 1999-03-19
NaN
- +0000
- 19.85
+ NaN
+ 19.05
NaN
NaN
1
- USGS
+ NaN
D
2
- S
+ NaN
S
A
+ 72019
NaT
USGS
434400121275801
GW
- 1998-12-15
+ 1999-05-14
NaN
- +0000
- 20.33
NaN
NaN
+ 4201.99
+ NGVD29
1
USGS
D
@@ -438,25 +448,27 @@ Interpreting the ResultS
S
A
+ 62610
NaT
USGS
434400121275801
GW
- 1999-03-19
+ 1999-05-14
NaN
- +0000
- 19.05
NaN
NaN
+ 4206.01
+ NAVD88
1
- NaN
+ USGS
D
2
- NaN
+ S
S
A
+ 62611
NaT
@@ -465,7 +477,7 @@ Interpreting the ResultGW
1999-05-14
NaN
- +0000
+ NaN
18.01
NaN
NaN
@@ -476,10 +488,11 @@ Interpreting the ResultS
S
A
+ 72019
-
248 rows × 16 columns
+744 rows × 17 columns
Show the data types of the columns in the resulting data frame.
@@ -504,7 +517,7 @@[7]:
ax = data[0].plot(y='lev_va')
+ax = data[0].plot(x = 'lev_dt', y='lev_va')
ax.set_xlabel('Date')
ax.set_ylabel('Water Level (feet below land surface)')
[7]:
+
----------------------------------------------------------------------------
-ValueError Traceback (most recent call last)
-File ~/.local/lib/python3.10/site-packages/matplotlib/axis.py:1804, in Axis.convert_units(self, x)
- 1803 try:
--> 1804 ret = self.converter.convert(x, self.units, self)
- 1805 except Exception as e:
-
-File ~/.local/lib/python3.10/site-packages/pandas/plotting/_matplotlib/converter.py:295, in DatetimeConverter.convert(values, unit, axis)
- 294 else:
---> 295 values = DatetimeConverter._convert_1d(values, unit, axis)
- 296 return values
-
-File ~/.local/lib/python3.10/site-packages/pandas/plotting/_matplotlib/converter.py:330, in DatetimeConverter._convert_1d(values, unit, axis)
- 328 pass
---> 330 values = mdates.date2num(values)
- 332 return values
-
-File ~/.local/lib/python3.10/site-packages/matplotlib/dates.py:447, in date2num(d)
- 445 if tzi is not None:
- 446 # make datetime naive:
---> 447 d = [dt.astimezone(UTC).replace(tzinfo=None) for dt in d]
- 448 d = np.asarray(d)
-
-File ~/.local/lib/python3.10/site-packages/matplotlib/dates.py:447, in <listcomp>(.0)
- 445 if tzi is not None:
- 446 # make datetime naive:
---> 447 d = [dt.astimezone(UTC).replace(tzinfo=None) for dt in d]
- 448 d = np.asarray(d)
-
-File nattype.pyx:54, in pandas._libs.tslibs.nattype._make_error_func.f()
-
-ValueError: NaTType does not support astimezone
-
-The above exception was the direct cause of the following exception:
-
-ConversionError Traceback (most recent call last)
-Cell In[7], line 1
-----> 1 ax = data[0].plot(y='lev_va')
- 2 ax.set_xlabel('Date')
- 3 ax.set_ylabel('Water Level (feet below land surface)')
-
-File ~/.local/lib/python3.10/site-packages/pandas/plotting/_core.py:1030, in PlotAccessor.__call__(self, *args, **kwargs)
- 1027 label_name = label_kw or data.columns
- 1028 data.columns = label_name
--> 1030 return plot_backend.plot(data, kind=kind, **kwargs)
-
-File ~/.local/lib/python3.10/site-packages/pandas/plotting/_matplotlib/__init__.py:71, in plot(data, kind, **kwargs)
- 69 kwargs["ax"] = getattr(ax, "left_ax", ax)
- 70 plot_obj = PLOT_CLASSES[kind](data, **kwargs)
----> 71 plot_obj.generate()
- 72 plot_obj.draw()
- 73 return plot_obj.result
-
-File ~/.local/lib/python3.10/site-packages/pandas/plotting/_matplotlib/core.py:501, in MPLPlot.generate(self)
- 499 self._compute_plot_data()
- 500 fig = self.fig
---> 501 self._make_plot(fig)
- 502 self._add_table()
- 503 self._make_legend()
-
-File ~/.local/lib/python3.10/site-packages/pandas/plotting/_matplotlib/core.py:1544, in LinePlot._make_plot(self, fig)
- 1541 label = self._mark_right_label(label, index=i)
- 1542 kwds["label"] = label
--> 1544 newlines = plotf(
- 1545 ax,
- 1546 x,
- 1547 y,
- 1548 style=style,
- 1549 column_num=i,
- 1550 stacking_id=stacking_id,
- 1551 is_errorbar=is_errorbar,
- 1552 **kwds,
- 1553 )
- 1554 self._append_legend_handles_labels(newlines[0], label)
- 1556 if self._is_ts_plot():
- 1557 # reset of xlim should be used for ts data
- 1558 # TODO: GH28021, should find a way to change view limit on xaxis
-
-File ~/.local/lib/python3.10/site-packages/pandas/plotting/_matplotlib/core.py:1580, in LinePlot._plot(cls, ax, x, y, style, column_num, stacking_id, **kwds)
- 1578 cls._initialize_stacker(ax, stacking_id, len(y))
- 1579 y_values = cls._get_stacked_values(ax, stacking_id, y, kwds["label"])
--> 1580 lines = MPLPlot._plot(ax, x, y_values, style=style, **kwds)
- 1581 cls._update_stacker(ax, stacking_id, y)
- 1582 return lines
-
-File ~/.local/lib/python3.10/site-packages/pandas/plotting/_matplotlib/converter.py:95, in register_pandas_matplotlib_converters.<locals>.wrapper(*args, **kwargs)
- 92 @functools.wraps(func)
- 93 def wrapper(*args, **kwargs):
- 94 with pandas_converters():
----> 95 return func(*args, **kwargs)
-
-File ~/.local/lib/python3.10/site-packages/pandas/plotting/_matplotlib/core.py:975, in MPLPlot._plot(cls, ax, x, y, style, is_errorbar, **kwds)
- 972 else:
- 973 # prevent style kwarg from going to errorbar, where it is unsupported
- 974 args = (x, y, style) if style is not None else (x, y)
---> 975 return ax.plot(*args, **kwds)
-
-File ~/.local/lib/python3.10/site-packages/matplotlib/axes/_axes.py:1781, in Axes.plot(self, scalex, scaley, data, *args, **kwargs)
- 1779 lines = [*self._get_lines(self, *args, data=data, **kwargs)]
- 1780 for line in lines:
--> 1781 self.add_line(line)
- 1782 if scalex:
- 1783 self._request_autoscale_view("x")
-
-File ~/.local/lib/python3.10/site-packages/matplotlib/axes/_base.py:2339, in _AxesBase.add_line(self, line)
- 2336 if line.get_clip_path() is None:
- 2337 line.set_clip_path(self.patch)
--> 2339 self._update_line_limits(line)
- 2340 if not line.get_label():
- 2341 line.set_label(f'_child{len(self._children)}')
-
-File ~/.local/lib/python3.10/site-packages/matplotlib/axes/_base.py:2362, in _AxesBase._update_line_limits(self, line)
- 2358 def _update_line_limits(self, line):
- 2359 """
- 2360 Figures out the data limit of the given line, updating self.dataLim.
- 2361 """
--> 2362 path = line.get_path()
- 2363 if path.vertices.size == 0:
- 2364 return
-
-File ~/.local/lib/python3.10/site-packages/matplotlib/lines.py:1037, in Line2D.get_path(self)
- 1035 """Return the `~matplotlib.path.Path` associated with this line."""
- 1036 if self._invalidy or self._invalidx:
--> 1037 self.recache()
- 1038 return self._path
-
-File ~/.local/lib/python3.10/site-packages/matplotlib/lines.py:673, in Line2D.recache(self, always)
- 671 def recache(self, always=False):
- 672 if always or self._invalidx:
---> 673 xconv = self.convert_xunits(self._xorig)
- 674 x = _to_unmasked_float_array(xconv).ravel()
- 675 else:
-
-File ~/.local/lib/python3.10/site-packages/matplotlib/artist.py:279, in Artist.convert_xunits(self, x)
- 277 if ax is None or ax.xaxis is None:
- 278 return x
---> 279 return ax.xaxis.convert_units(x)
-
-File ~/.local/lib/python3.10/site-packages/matplotlib/axis.py:1806, in Axis.convert_units(self, x)
- 1804 ret = self.converter.convert(x, self.units, self)
- 1805 except Exception as e:
--> 1806 raise munits.ConversionError('Failed to convert value(s) to axis '
- 1807 f'units: {x!r}') from e
- 1808 return ret
-
-ConversionError: Failed to convert value(s) to axis units: array([Timestamp('1945-10-12 22:35:00+0000', tz='UTC'),
- Timestamp('1999-06-04 18:00:00+0000', tz='UTC'),
- Timestamp('1999-08-19 17:25:00+0000', tz='UTC'),
- Timestamp('1999-11-19 18:40:00+0000', tz='UTC'),
- Timestamp('2000-02-11 17:25:00+0000', tz='UTC'),
- Timestamp('2000-03-09 22:30:00+0000', tz='UTC'),
- Timestamp('2000-05-26 16:00:00+0000', tz='UTC'),
- Timestamp('2000-08-22 21:55:00+0000', tz='UTC'),
- Timestamp('2000-11-15 21:59:00+0000', tz='UTC'),
- Timestamp('2001-03-21 00:03:00+0000', tz='UTC'),
- Timestamp('2001-05-05 01:10:00+0000', tz='UTC'),
- Timestamp('2001-05-30 20:13:00+0000', tz='UTC'),
- Timestamp('2001-07-18 17:15:00+0000', tz='UTC'),
- Timestamp('2001-08-30 15:34:00+0000', tz='UTC'),
- Timestamp('2001-09-26 15:49:00+0000', tz='UTC'),
- Timestamp('2001-10-30 23:09:00+0000', tz='UTC'),
- Timestamp('2001-11-29 18:00:00+0000', tz='UTC'),
- Timestamp('2001-12-27 22:33:00+0000', tz='UTC'),
- Timestamp('2002-01-28 22:09:00+0000', tz='UTC'),
- Timestamp('2002-02-25 22:50:00+0000', tz='UTC'),
- Timestamp('2002-03-25 22:01:00+0000', tz='UTC'),
- Timestamp('2002-04-30 16:50:00+0000', tz='UTC'),
- Timestamp('2002-05-30 22:05:00+0000', tz='UTC'),
- Timestamp('2002-08-14 18:24:00+0000', tz='UTC'),
- Timestamp('2002-09-12 15:41:00+0000', tz='UTC'),
- Timestamp('2002-11-13 22:45:00+0000', tz='UTC'),
- Timestamp('2003-02-11 22:57:00+0000', tz='UTC'),
- Timestamp('2003-05-13 21:23:00+0000', tz='UTC'),
- Timestamp('2003-09-09 23:29:00+0000', tz='UTC'),
- Timestamp('2003-12-01 22:59:00+0000', tz='UTC'),
- Timestamp('2004-01-18 22:42:00+0000', tz='UTC'),
- Timestamp('2004-04-30 19:46:00+0000', tz='UTC'),
- Timestamp('2004-07-15 17:53:00+0000', tz='UTC'),
- Timestamp('2004-10-15 17:38:00+0000', tz='UTC'),
- Timestamp('2005-01-07 18:24:00+0000', tz='UTC'),
- Timestamp('2005-04-08 17:13:00+0000', tz='UTC'),
- Timestamp('2005-07-15 16:47:00+0000', tz='UTC'),
- Timestamp('2005-10-07 17:52:00+0000', tz='UTC'),
- Timestamp('2006-01-13 19:23:00+0000', tz='UTC'),
- Timestamp('2006-05-26 14:16:00+0000', tz='UTC'),
- Timestamp('2006-07-14 18:22:00+0000', tz='UTC'),
- Timestamp('2006-10-19 23:15:00+0000', tz='UTC'),
- Timestamp('2007-01-12 19:10:00+0000', tz='UTC'),
- Timestamp('2007-04-06 15:34:00+0000', tz='UTC'),
- Timestamp('2007-10-04 23:40:00+0000', tz='UTC'),
- Timestamp('2008-04-03 21:55:00+0000', tz='UTC'),
- Timestamp('2008-10-29 21:33:00+0000', tz='UTC'),
- Timestamp('2009-05-20 18:29:00+0000', tz='UTC'),
- Timestamp('2009-06-09 16:33:00+0000', tz='UTC'),
- Timestamp('2009-11-25 17:33:00+0000', tz='UTC'),
- Timestamp('2010-05-28 16:50:00+0000', tz='UTC'),
- Timestamp('2010-11-29 23:20:00+0000', tz='UTC'),
- Timestamp('2011-10-07 18:58:00+0000', tz='UTC'),
- Timestamp('2012-10-11 21:24:00+0000', tz='UTC'),
- Timestamp('2012-10-12 01:49:00+0000', tz='UTC'),
- Timestamp('2013-10-31 17:42:00+0000', tz='UTC'),
- Timestamp('2014-10-15 21:07:00+0000', tz='UTC'),
- Timestamp('2015-10-22 17:52:00+0000', tz='UTC'),
- Timestamp('2016-10-26 16:22:00+0000', tz='UTC'), NaT, NaT, NaT,
- NaT, NaT, NaT, NaT, NaT, NaT, NaT, NaT, NaT, NaT, NaT, NaT, NaT,
- NaT, NaT, NaT, NaT, NaT, NaT, NaT, NaT, NaT, NaT, NaT, NaT, NaT,
- NaT, NaT, NaT, NaT, NaT, NaT, NaT, NaT, NaT, NaT, NaT, NaT, NaT,
- NaT, NaT, NaT, NaT, NaT, NaT, NaT, NaT, NaT, NaT, NaT, NaT, NaT,
- NaT, NaT, NaT, NaT, NaT, NaT, NaT, NaT, NaT, NaT, NaT, NaT, NaT,
- NaT, NaT, NaT, NaT, NaT, NaT, NaT, NaT, NaT, NaT, NaT, NaT, NaT,
- NaT, NaT, NaT, NaT, NaT, NaT, NaT, NaT, NaT, NaT, NaT, NaT, NaT,
- NaT, NaT, NaT, NaT, NaT, NaT, NaT, NaT, NaT, NaT, NaT, NaT, NaT,
- NaT, NaT, NaT, NaT, NaT, NaT, NaT, NaT, NaT, NaT, NaT, NaT, NaT,
- NaT, NaT, NaT, NaT, NaT, NaT, NaT, NaT, NaT, NaT, NaT, NaT, NaT,
- NaT, NaT, NaT, NaT, NaT, NaT, NaT, NaT, NaT, NaT, NaT, NaT, NaT,
- NaT, NaT, NaT, NaT, NaT, NaT, NaT, NaT, NaT, NaT, NaT, NaT, NaT,
- NaT, NaT, NaT, NaT, NaT, NaT, NaT, NaT, NaT, NaT, NaT, NaT, NaT,
- NaT, NaT, NaT, NaT, NaT, NaT, NaT, NaT, NaT, NaT, NaT, NaT, NaT,
- NaT, NaT, NaT, NaT], dtype=object)
+Text(0, 0.5, 'Water Level (feet below land surface)')
-The query URL used to retrieve the data from NWIS was: https://waterservices.usgs.gov/nwis/gwlevels?startDT=1851-01-01&sites=434400121275801&format=rdb
+The query URL used to retrieve the data from NWIS was: https://nwis.waterdata.usgs.gov/nwis/gwlevels?format=rdb&begin_date=1851-01-01&site_no=434400121275801
-Retrieved 311 data values.
+Retrieved 933 data values.
-/home/runner/.local/lib/python3.10/site-packages/dataretrieval/utils.py:89: UserWarning: Warning: 207 incomplete dates found, consider setting datetime_index to False.
+/home/runner/.local/lib/python3.10/site-packages/dataretrieval/utils.py:89: UserWarning: Warning: 621 incomplete dates found, consider setting datetime_index to False.
warnings.warn(
-Retrieved 34 data values.
+Retrieved 102 data values.
DatetimeIndex(['NaT', 'NaT', 'NaT', 'NaT', 'NaT', 'NaT', 'NaT', 'NaT', 'NaT',
+ 'NaT',
+ ...
'NaT', 'NaT', 'NaT', 'NaT', 'NaT', 'NaT', 'NaT', 'NaT', 'NaT',
- 'NaT', 'NaT', 'NaT', 'NaT', 'NaT', 'NaT', 'NaT', 'NaT', 'NaT',
- 'NaT', 'NaT', 'NaT', 'NaT', 'NaT', 'NaT', 'NaT'],
- dtype='datetime64[ns, UTC]', name='datetime', freq=None)
+ 'NaT'],
+ dtype='datetime64[ns, UTC]', name='datetime', length=102, freq=None)
-/home/runner/.local/lib/python3.10/site-packages/dataretrieval/utils.py:89: UserWarning: Warning: 34 incomplete dates found, consider setting datetime_index to False.
+/home/runner/.local/lib/python3.10/site-packages/dataretrieval/utils.py:89: UserWarning: Warning: 102 incomplete dates found, consider setting datetime_index to False.
warnings.warn(
-You can examine the data retrieved from NWIS at: https://waterservices.usgs.gov/nwis/gwlevels?startDT=1851-01-01&sites=425957088141001&format=rdb
+You can examine the data retrieved from NWIS at: https://nwis.waterdata.usgs.gov/nwis/gwlevels?format=rdb&begin_date=1851-01-01&site_no=425957088141001
You can also retrieve data for a site within a specified time window by specifying a start date and an end date.
@@ -1172,7 +983,7 @@
-Retrieved 71 data values.
+Retrieved 213 data values.
-/home/runner/.local/lib/python3.10/site-packages/dataretrieval/utils.py:89: UserWarning: Warning: 63 incomplete dates found, consider setting datetime_index to False.
+/home/runner/.local/lib/python3.10/site-packages/dataretrieval/utils.py:89: UserWarning: Warning: 189 incomplete dates found, consider setting datetime_index to False.
warnings.warn(
248 rows × 16 columns
\n", + "744 rows × 17 columns
\n", "" ], "text/plain": [ " agency_cd site_no site_tp_cd lev_dt \\\n", "datetime \n", "1945-10-12 22:35:00+00:00 USGS 434400121275801 GW 1945-10-12 \n", + "1945-10-12 22:35:00+00:00 USGS 434400121275801 GW 1945-10-12 \n", + "1945-10-12 22:35:00+00:00 USGS 434400121275801 GW 1945-10-12 \n", + "1999-06-04 18:00:00+00:00 USGS 434400121275801 GW 1999-06-04 \n", "1999-06-04 18:00:00+00:00 USGS 434400121275801 GW 1999-06-04 \n", - "1999-08-19 17:25:00+00:00 USGS 434400121275801 GW 1999-08-19 \n", - "1999-11-19 18:40:00+00:00 USGS 434400121275801 GW 1999-11-19 \n", - "2000-02-11 17:25:00+00:00 USGS 434400121275801 GW 2000-02-11 \n", "... ... ... ... ... \n", - "NaT USGS 434400121275801 GW 1998-09-25 \n", - "NaT USGS 434400121275801 GW 1998-11-19 \n", - "NaT USGS 434400121275801 GW 1998-12-15 \n", "NaT USGS 434400121275801 GW 1999-03-19 \n", + "NaT USGS 434400121275801 GW 1999-03-19 \n", + "NaT USGS 434400121275801 GW 1999-05-14 \n", + "NaT USGS 434400121275801 GW 1999-05-14 \n", "NaT USGS 434400121275801 GW 1999-05-14 \n", "\n", - " lev_tm lev_tz_cd lev_va sl_lev_va sl_datum_cd \\\n", - "datetime \n", - "1945-10-12 22:35:00+00:00 22:35 +0000 27.35 NaN NaN \n", - "1999-06-04 18:00:00+00:00 18:00 +0000 16.78 NaN NaN \n", - "1999-08-19 17:25:00+00:00 17:25 +0000 15.06 NaN NaN \n", - "1999-11-19 18:40:00+00:00 18:40 +0000 17.62 NaN NaN \n", - "2000-02-11 17:25:00+00:00 17:25 +0000 21.00 NaN NaN \n", - "... ... ... ... ... ... \n", - "NaT NaN +0000 17.36 NaN NaN \n", - "NaT NaN +0000 19.85 NaN NaN \n", - "NaT NaN +0000 20.33 NaN NaN \n", - "NaT NaN +0000 19.05 NaN NaN \n", - "NaT NaN +0000 18.01 NaN NaN \n", + " lev_tm lev_tz_cd lev_va sl_lev_va sl_datum_cd \\\n", + "datetime \n", + "1945-10-12 22:35:00+00:00 22:35 +0000 NaN 4192.65 NGVD29 \n", + "1945-10-12 22:35:00+00:00 22:35 +0000 NaN 4196.67 NAVD88 \n", + "1945-10-12 22:35:00+00:00 22:35 +0000 27.35 NaN NaN \n", + "1999-06-04 18:00:00+00:00 18:00 +0000 NaN 4203.22 NGVD29 \n", + "1999-06-04 18:00:00+00:00 18:00 +0000 NaN 4207.24 NAVD88 \n", + "... ... ... ... ... ... \n", + "NaT NaN NaN NaN 4204.97 NAVD88 \n", + "NaT NaN NaN 19.05 NaN NaN \n", + "NaT NaN NaN NaN 4201.99 NGVD29 \n", + "NaT NaN NaN NaN 4206.01 NAVD88 \n", + "NaT NaN NaN 18.01 NaN NaN \n", "\n", " lev_status_cd lev_agency_cd lev_dt_acy_cd \\\n", "datetime \n", "1945-10-12 22:35:00+00:00 1 USGS m \n", + "1945-10-12 22:35:00+00:00 1 USGS m \n", + "1945-10-12 22:35:00+00:00 1 USGS m \n", + "1999-06-04 18:00:00+00:00 1 USGS m \n", "1999-06-04 18:00:00+00:00 1 USGS m \n", - "1999-08-19 17:25:00+00:00 1 USGS m \n", - "1999-11-19 18:40:00+00:00 1 USGS m \n", - "2000-02-11 17:25:00+00:00 1 USGS m \n", "... ... ... ... \n", "NaT 1 NaN D \n", + "NaT 1 NaN D \n", "NaT 1 USGS D \n", "NaT 1 USGS D \n", - "NaT 1 NaN D \n", "NaT 1 USGS D \n", "\n", - " lev_acy_cd lev_src_cd lev_meth_cd lev_age_cd \n", - "datetime \n", - "1945-10-12 22:35:00+00:00 2 S O A \n", - "1999-06-04 18:00:00+00:00 2 S S A \n", - "1999-08-19 17:25:00+00:00 2 S V A \n", - "1999-11-19 18:40:00+00:00 2 S S A \n", - "2000-02-11 17:25:00+00:00 2 S S A \n", - "... ... ... ... ... \n", - "NaT 2 NaN S A \n", - "NaT 2 S S A \n", - "NaT 2 S S A \n", - "NaT 2 NaN S A \n", - "NaT 2 S S A \n", + " lev_acy_cd lev_src_cd lev_meth_cd lev_age_cd \\\n", + "datetime \n", + "1945-10-12 22:35:00+00:00 2 S O A \n", + "1945-10-12 22:35:00+00:00 2 S O A \n", + "1945-10-12 22:35:00+00:00 2 S O A \n", + "1999-06-04 18:00:00+00:00 2 S S A \n", + "1999-06-04 18:00:00+00:00 2 S S A \n", + "... ... ... ... ... \n", + "NaT 2 NaN S A \n", + "NaT 2 NaN S A \n", + "NaT 2 S S A \n", + "NaT 2 S S A \n", + "NaT 2 S S A \n", + "\n", + " parameter_cd \n", + "datetime \n", + "1945-10-12 22:35:00+00:00 62610 \n", + "1945-10-12 22:35:00+00:00 62611 \n", + "1945-10-12 22:35:00+00:00 72019 \n", + "1999-06-04 18:00:00+00:00 62610 \n", + "1999-06-04 18:00:00+00:00 62611 \n", + "... ... \n", + "NaT 62611 \n", + "NaT 72019 \n", + "NaT 62610 \n", + "NaT 62611 \n", + "NaT 72019 \n", "\n", - "[248 rows x 16 columns]" + "[744 rows x 17 columns]" ] }, "metadata": {}, @@ -577,10 +604,10 @@ "metadata": { "collapsed": false, "execution": { - "iopub.execute_input": "2024-07-19T16:00:14.817637Z", - "iopub.status.busy": "2024-07-19T16:00:14.817131Z", - "iopub.status.idle": "2024-07-19T16:00:14.821160Z", - "shell.execute_reply": "2024-07-19T16:00:14.820587Z" + "iopub.execute_input": "2024-08-02T00:48:23.294776Z", + "iopub.status.busy": "2024-08-02T00:48:23.294592Z", + "iopub.status.idle": "2024-08-02T00:48:23.297795Z", + "shell.execute_reply": "2024-08-02T00:48:23.297330Z" }, "pycharm": { "name": "#%%\n" @@ -599,7 +626,7 @@ "lev_tz_cd object\n", "lev_va float64\n", "sl_lev_va float64\n", - "sl_datum_cd float64\n", + "sl_datum_cd object\n", "lev_status_cd object\n", "lev_agency_cd object\n", "lev_dt_acy_cd object\n", @@ -607,6 +634,7 @@ "lev_src_cd object\n", "lev_meth_cd object\n", "lev_age_cd object\n", + "parameter_cd object\n", "dtype: object\n" ] } @@ -633,10 +661,10 @@ "metadata": { "collapsed": false, "execution": { - "iopub.execute_input": "2024-07-19T16:00:14.823440Z", - "iopub.status.busy": "2024-07-19T16:00:14.822984Z", - "iopub.status.idle": "2024-07-19T16:00:14.829266Z", - "shell.execute_reply": "2024-07-19T16:00:14.828678Z" + "iopub.execute_input": "2024-08-02T00:48:23.299960Z", + "iopub.status.busy": "2024-08-02T00:48:23.299543Z", + "iopub.status.idle": "2024-08-02T00:48:23.305376Z", + "shell.execute_reply": "2024-08-02T00:48:23.304922Z" }, "pycharm": { "name": "#%%\n" @@ -684,10 +712,10 @@ "metadata": { "collapsed": false, "execution": { - "iopub.execute_input": "2024-07-19T16:00:14.831588Z", - "iopub.status.busy": "2024-07-19T16:00:14.831386Z", - "iopub.status.idle": "2024-07-19T16:00:16.530360Z", - "shell.execute_reply": "2024-07-19T16:00:16.529578Z" + "iopub.execute_input": "2024-08-02T00:48:23.307463Z", + "iopub.status.busy": "2024-08-02T00:48:23.307114Z", + "iopub.status.idle": "2024-08-02T00:48:23.688763Z", + "shell.execute_reply": "2024-08-02T00:48:23.688138Z" }, "pycharm": { "name": "#%%\n" @@ -695,42 +723,18 @@ }, "outputs": [ { - "ename": "ConversionError", - "evalue": "Failed to convert value(s) to axis units: array([Timestamp('1945-10-12 22:35:00+0000', tz='UTC'),\n Timestamp('1999-06-04 18:00:00+0000', tz='UTC'),\n Timestamp('1999-08-19 17:25:00+0000', tz='UTC'),\n Timestamp('1999-11-19 18:40:00+0000', tz='UTC'),\n Timestamp('2000-02-11 17:25:00+0000', tz='UTC'),\n Timestamp('2000-03-09 22:30:00+0000', tz='UTC'),\n Timestamp('2000-05-26 16:00:00+0000', tz='UTC'),\n Timestamp('2000-08-22 21:55:00+0000', tz='UTC'),\n Timestamp('2000-11-15 21:59:00+0000', tz='UTC'),\n Timestamp('2001-03-21 00:03:00+0000', tz='UTC'),\n Timestamp('2001-05-05 01:10:00+0000', tz='UTC'),\n Timestamp('2001-05-30 20:13:00+0000', tz='UTC'),\n Timestamp('2001-07-18 17:15:00+0000', tz='UTC'),\n Timestamp('2001-08-30 15:34:00+0000', tz='UTC'),\n Timestamp('2001-09-26 15:49:00+0000', tz='UTC'),\n Timestamp('2001-10-30 23:09:00+0000', tz='UTC'),\n Timestamp('2001-11-29 18:00:00+0000', tz='UTC'),\n Timestamp('2001-12-27 22:33:00+0000', tz='UTC'),\n Timestamp('2002-01-28 22:09:00+0000', tz='UTC'),\n Timestamp('2002-02-25 22:50:00+0000', tz='UTC'),\n Timestamp('2002-03-25 22:01:00+0000', tz='UTC'),\n Timestamp('2002-04-30 16:50:00+0000', tz='UTC'),\n Timestamp('2002-05-30 22:05:00+0000', tz='UTC'),\n Timestamp('2002-08-14 18:24:00+0000', tz='UTC'),\n Timestamp('2002-09-12 15:41:00+0000', tz='UTC'),\n Timestamp('2002-11-13 22:45:00+0000', tz='UTC'),\n Timestamp('2003-02-11 22:57:00+0000', tz='UTC'),\n Timestamp('2003-05-13 21:23:00+0000', tz='UTC'),\n Timestamp('2003-09-09 23:29:00+0000', tz='UTC'),\n Timestamp('2003-12-01 22:59:00+0000', tz='UTC'),\n Timestamp('2004-01-18 22:42:00+0000', tz='UTC'),\n Timestamp('2004-04-30 19:46:00+0000', tz='UTC'),\n Timestamp('2004-07-15 17:53:00+0000', tz='UTC'),\n Timestamp('2004-10-15 17:38:00+0000', tz='UTC'),\n Timestamp('2005-01-07 18:24:00+0000', tz='UTC'),\n Timestamp('2005-04-08 17:13:00+0000', tz='UTC'),\n Timestamp('2005-07-15 16:47:00+0000', tz='UTC'),\n Timestamp('2005-10-07 17:52:00+0000', tz='UTC'),\n Timestamp('2006-01-13 19:23:00+0000', tz='UTC'),\n Timestamp('2006-05-26 14:16:00+0000', tz='UTC'),\n Timestamp('2006-07-14 18:22:00+0000', tz='UTC'),\n Timestamp('2006-10-19 23:15:00+0000', tz='UTC'),\n Timestamp('2007-01-12 19:10:00+0000', tz='UTC'),\n Timestamp('2007-04-06 15:34:00+0000', tz='UTC'),\n Timestamp('2007-10-04 23:40:00+0000', tz='UTC'),\n Timestamp('2008-04-03 21:55:00+0000', tz='UTC'),\n Timestamp('2008-10-29 21:33:00+0000', tz='UTC'),\n Timestamp('2009-05-20 18:29:00+0000', tz='UTC'),\n Timestamp('2009-06-09 16:33:00+0000', tz='UTC'),\n Timestamp('2009-11-25 17:33:00+0000', tz='UTC'),\n Timestamp('2010-05-28 16:50:00+0000', tz='UTC'),\n Timestamp('2010-11-29 23:20:00+0000', tz='UTC'),\n Timestamp('2011-10-07 18:58:00+0000', tz='UTC'),\n Timestamp('2012-10-11 21:24:00+0000', tz='UTC'),\n Timestamp('2012-10-12 01:49:00+0000', tz='UTC'),\n Timestamp('2013-10-31 17:42:00+0000', tz='UTC'),\n Timestamp('2014-10-15 21:07:00+0000', tz='UTC'),\n Timestamp('2015-10-22 17:52:00+0000', tz='UTC'),\n Timestamp('2016-10-26 16:22:00+0000', tz='UTC'), NaT, NaT, NaT,\n NaT, NaT, NaT, NaT, NaT, NaT, NaT, NaT, NaT, NaT, NaT, NaT, NaT,\n NaT, NaT, NaT, NaT, NaT, NaT, NaT, NaT, NaT, NaT, NaT, NaT, NaT,\n NaT, NaT, NaT, NaT, NaT, NaT, NaT, NaT, NaT, NaT, NaT, NaT, NaT,\n NaT, NaT, NaT, NaT, NaT, NaT, NaT, NaT, NaT, NaT, NaT, NaT, NaT,\n NaT, NaT, NaT, NaT, NaT, NaT, NaT, NaT, NaT, NaT, NaT, NaT, NaT,\n NaT, NaT, NaT, NaT, NaT, NaT, NaT, NaT, NaT, NaT, NaT, NaT, NaT,\n NaT, NaT, NaT, NaT, NaT, NaT, NaT, NaT, NaT, NaT, NaT, NaT, NaT,\n NaT, NaT, NaT, NaT, NaT, NaT, NaT, NaT, NaT, NaT, NaT, NaT, NaT,\n NaT, NaT, NaT, NaT, NaT, NaT, NaT, NaT, NaT, NaT, NaT, NaT, NaT,\n NaT, NaT, NaT, NaT, NaT, NaT, NaT, NaT, NaT, NaT, NaT, NaT, NaT,\n NaT, NaT, NaT, NaT, NaT, NaT, NaT, NaT, NaT, NaT, NaT, NaT, NaT,\n NaT, NaT, NaT, NaT, NaT, NaT, NaT, NaT, NaT, NaT, NaT, NaT, NaT,\n NaT, NaT, NaT, NaT, NaT, NaT, NaT, NaT, NaT, NaT, NaT, NaT, NaT,\n NaT, NaT, NaT, NaT, NaT, NaT, NaT, NaT, NaT, NaT, NaT, NaT, NaT,\n NaT, NaT, NaT, NaT], dtype=object)", - "output_type": "error", - "traceback": [ - "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", - "\u001b[0;31mValueError\u001b[0m Traceback (most recent call last)", - "File \u001b[0;32m~/.local/lib/python3.10/site-packages/matplotlib/axis.py:1804\u001b[0m, in \u001b[0;36mAxis.convert_units\u001b[0;34m(self, x)\u001b[0m\n\u001b[1;32m 1803\u001b[0m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[0;32m-> 1804\u001b[0m ret \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mconverter\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mconvert\u001b[49m\u001b[43m(\u001b[49m\u001b[43mx\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43munits\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[43m)\u001b[49m\n\u001b[1;32m 1805\u001b[0m \u001b[38;5;28;01mexcept\u001b[39;00m \u001b[38;5;167;01mException\u001b[39;00m \u001b[38;5;28;01mas\u001b[39;00m e:\n", - "File \u001b[0;32m~/.local/lib/python3.10/site-packages/pandas/plotting/_matplotlib/converter.py:295\u001b[0m, in \u001b[0;36mDatetimeConverter.convert\u001b[0;34m(values, unit, axis)\u001b[0m\n\u001b[1;32m 294\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[0;32m--> 295\u001b[0m values \u001b[38;5;241m=\u001b[39m \u001b[43mDatetimeConverter\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_convert_1d\u001b[49m\u001b[43m(\u001b[49m\u001b[43mvalues\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43munit\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43maxis\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 296\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m values\n", - "File \u001b[0;32m~/.local/lib/python3.10/site-packages/pandas/plotting/_matplotlib/converter.py:330\u001b[0m, in \u001b[0;36mDatetimeConverter._convert_1d\u001b[0;34m(values, unit, axis)\u001b[0m\n\u001b[1;32m 328\u001b[0m \u001b[38;5;28;01mpass\u001b[39;00m\n\u001b[0;32m--> 330\u001b[0m values \u001b[38;5;241m=\u001b[39m \u001b[43mmdates\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mdate2num\u001b[49m\u001b[43m(\u001b[49m\u001b[43mvalues\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 332\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m values\n", - "File \u001b[0;32m~/.local/lib/python3.10/site-packages/matplotlib/dates.py:447\u001b[0m, in \u001b[0;36mdate2num\u001b[0;34m(d)\u001b[0m\n\u001b[1;32m 445\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m tzi \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m:\n\u001b[1;32m 446\u001b[0m \u001b[38;5;66;03m# make datetime naive:\u001b[39;00m\n\u001b[0;32m--> 447\u001b[0m d \u001b[38;5;241m=\u001b[39m [dt\u001b[38;5;241m.\u001b[39mastimezone(UTC)\u001b[38;5;241m.\u001b[39mreplace(tzinfo\u001b[38;5;241m=\u001b[39m\u001b[38;5;28;01mNone\u001b[39;00m) \u001b[38;5;28;01mfor\u001b[39;00m dt \u001b[38;5;129;01min\u001b[39;00m d]\n\u001b[1;32m 448\u001b[0m d \u001b[38;5;241m=\u001b[39m np\u001b[38;5;241m.\u001b[39masarray(d)\n", - "File \u001b[0;32m~/.local/lib/python3.10/site-packages/matplotlib/dates.py:447\u001b[0m, in \u001b[0;36m