Quadica dataset
This file shows how to use the Quadica dataset from the aqua_fetch package.
[1]:
# sphinx_gallery_thumbnail_number = 3
import os
import site
if __name__ == '__main__':
wd_dir = os.path.dirname(os.path.dirname(os.path.dirname(os.path.dirname(os.path.realpath('__file__')))))
# wd_dir = os.path.dirname(os.path.dirname(os.path.realpath('__file__')))
print(wd_dir)
site.addsitedir(wd_dir)
import pandas as pd
import matplotlib.pyplot as plt
from easy_mpl import hist, ridge
from easy_mpl.utils import create_subplots
from aqua_fetch import Quadica
from aqua_fetch.utils import print_info
/home/docs/checkouts/readthedocs.org/user_builds/aquafetch/checkouts/latest
[2]:
print_info()
numpy 1.26.4
pandas 2.1.4
aqua_fetch 1.0.1
python 3.12.10 (main, May 6 2025, 11:38:28) [GCC 9.4.0]
os posix
matplotlib 3.8.4
shapefile 2.3.1
xarray 2024.7.0
netCDF4 1.7.4
scipy 1.17.0
fiona 1.10.1
Script Executed on: 11 February 2026 08:19:38
tot_cpus 2
avail_cpus 2
mem_gib 7.555534362792969
[3]:
dataset = Quadica()
Not downloading the data since the directory
/home/docs/checkouts/readthedocs.org/user_builds/aquafetch/checkouts/latest/aqua_fetch/data/Quadica already exists.
Use overwrite=True to remove previously saved files and download again
[4]:
avg_temp = dataset.avg_temp()
print(avg_temp.shape)
(828, 1386)
/home/docs/checkouts/readthedocs.org/user_builds/aquafetch/checkouts/latest/aqua_fetch/wq/_quadica.py:304: UserWarning: Could not infer format, so each element will be parsed individually, falling back to `dateutil`. To ensure parsing is consistent and as-expected, please specify a format.
temp.index = pd.to_datetime(temp.index)
[5]:
[5]:
| 1 | 2 | 3 | 4 | 8 | 9 | 10 | 11 | 12 | 16 | ... | 651 | 655 | 660 | 1002 | 1007 | 1012 | 1013 | 1277 | 1279 | 1281 | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Year_Month | |||||||||||||||||||||
| 1950-01-01 | -2.297333 | -2.459127 | -2.342236 | -2.014634 | -1.537954 | -1.470925 | -2.055828 | -2.097191 | -2.068334 | -1.822387 | ... | -1.627405 | -2.270952 | -2.310768 | 0.328745 | 0.124732 | -0.292483 | 0.567522 | -4.408611 | -4.568310 | -4.675208 |
| 1950-02-01 | 2.526310 | 2.694384 | 2.198610 | 2.699495 | 2.684751 | 2.752606 | 2.562898 | 2.520741 | 2.582700 | 2.225678 | ... | 2.099005 | 2.235437 | 2.112160 | 2.358829 | 2.370221 | 2.440856 | 2.475693 | 0.020008 | -0.113062 | -0.189216 |
| 1950-03-01 | 4.627410 | 4.638905 | 4.186086 | 4.550262 | 4.430630 | 4.496324 | 4.330999 | 4.378834 | 4.515958 | 4.683892 | ... | 4.605748 | 4.207512 | 4.194073 | 4.618830 | 4.334336 | 4.740807 | 4.700609 | 1.695298 | 1.543320 | 1.447536 |
| 1950-04-01 | 7.486832 | 7.736304 | 6.937535 | 7.645946 | 7.220503 | 7.269880 | 7.439249 | 7.441809 | 7.561507 | 6.772806 | ... | 6.720880 | 6.992037 | 6.863719 | 6.592855 | 6.411006 | 6.556426 | 6.743028 | 3.662794 | 3.435914 | 3.297304 |
| 1950-05-01 | 15.043045 | 15.376076 | 14.239087 | 15.069802 | 14.471546 | 14.508084 | 14.844470 | 14.888297 | 15.032875 | 13.734928 | ... | 13.117943 | 14.169679 | 14.103170 | 12.123150 | 11.489081 | 12.261512 | 12.224808 | 11.124089 | 10.931649 | 10.808384 |
5 rows × 1386 columns
pet
(828, 1386)
/home/docs/checkouts/readthedocs.org/user_builds/aquafetch/checkouts/latest/aqua_fetch/wq/_quadica.py:255: UserWarning: Could not infer format, so each element will be parsed individually, falling back to `dateutil`. To ensure parsing is consistent and as-expected, please specify a format.
pet.index = pd.to_datetime(pet.index)
precipitation
(828, 1386)
/home/docs/checkouts/readthedocs.org/user_builds/aquafetch/checkouts/latest/aqua_fetch/wq/_quadica.py:351: UserWarning: Could not infer format, so each element will be parsed individually, falling back to `dateutil`. To ensure parsing is consistent and as-expected, please specify a format.
pcp.index = pd.to_datetime(pcp.index)
monthly median values
[8]:
mon_medians = dataset.monthly_medians()
print(mon_medians.shape)
(16629, 17)
[9]:
[9]:
| Month | n_Q | median_Q | n_NO3 | median_NO3N | n_NMin | median_NMin | n_TN | median_TN | n_PO4 | median_PO4P | n_TP | median_TP | n_DOC | median_DOC | n_TOC | median_TOC | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| OBJECTID | |||||||||||||||||
| 1 | 1 | 0 | NaN | 11 | 1.700 | 11 | 1.960 | 11 | 3.60 | 11 | 0.0250 | 11 | 0.1180 | 0 | NaN | 11 | 6.60 |
| 1 | 2 | 0 | NaN | 12 | 1.740 | 12 | 1.975 | 12 | 4.30 | 12 | 0.0285 | 12 | 0.1375 | 0 | NaN | 12 | 6.85 |
| 1 | 3 | 0 | NaN | 11 | 1.900 | 11 | 2.100 | 11 | 4.70 | 11 | 0.0220 | 11 | 0.0880 | 0 | NaN | 11 | 7.50 |
| 1 | 4 | 0 | NaN | 10 | 1.405 | 10 | 1.580 | 10 | 2.95 | 10 | 0.0150 | 10 | 0.1115 | 0 | NaN | 10 | 7.00 |
| 1 | 5 | 0 | NaN | 11 | 1.000 | 11 | 1.260 | 11 | 2.60 | 11 | 0.0280 | 11 | 0.1550 | 0 | NaN | 11 | 9.00 |
[10]:
wrtds_mon = dataset.wrtds_monthly()
print(wrtds_mon.shape)
(50186, 47)
/home/docs/checkouts/readthedocs.org/user_builds/aquafetch/checkouts/latest/aqua_fetch/wq/_quadica.py:145: UserWarning: Could not infer format, so each element will be parsed individually, falling back to `dateutil`. To ensure parsing is consistent and as-expected, please specify a format.
wrtds.index = pd.to_datetime(wrtds['Year'].astype(str) + ' ' + wrtds['Month'].astype(str))
catchment attributes
[11]:
cat_attrs = dataset.catchment_attributes()
print(cat_attrs.shape)
(1386, 112)
[12]:
print(cat_attrs.columns)
Index(['Station', 'Area_km2', 'f_AreaGer', 'dem.mean', 'dem.median',
'slo.mean', 'slo.median', 'twi.mean', 'twi.med', 'twi.90p',
...
'flashi', 'BFI', 'P_mm', 'P_SIsw', 'P_SI', 'P_lambda', 'P_alpha',
'PET_mm', 'AI', 'T_mean'],
dtype='object', length=112)
[13]:
dataset.catchment_attributes(stations=['1', '2', '3'])
[13]:
| Station | Area_km2 | f_AreaGer | dem.mean | dem.median | slo.mean | slo.median | twi.mean | twi.med | twi.90p | ... | flashi | BFI | P_mm | P_SIsw | P_SI | P_lambda | P_alpha | PET_mm | AI | T_mean | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| OBJECTID | |||||||||||||||||||||
| 1 | BB_AMFL_0010 | 21.65 | 1.0 | 74.683632 | 72.135452 | 0.750141 | 0.678210 | 15.002993 | 14.357248 | 17.938291 | ... | NaN | NaN | 589.535167 | 1.338849 | 2.044286 | 0.322334 | 5.007660 | 760.654789 | 1.290294 | 9.425497 |
| 2 | BB_AZMFL_0010 | 50.47 | 1.0 | 61.898052 | 56.878677 | 1.157724 | 0.823584 | 14.753934 | 14.246800 | 17.612621 | ... | 0.0 | 0.878186 | 544.733603 | 1.661279 | 2.726427 | 0.306447 | 4.866778 | 774.804494 | 1.422743 | 9.381932 |
| 3 | BB_BAFL_0010 | 56.19 | 1.0 | 48.056680 | 50.443848 | 0.973699 | 0.846759 | 14.805566 | 14.195425 | 17.810382 | ... | NaN | NaN | 535.680048 | 1.813461 | 3.034012 | 0.308551 | 4.753558 | 719.133840 | 1.342496 | 8.983454 |
3 rows × 112 columns
monthly data
/home/docs/checkouts/readthedocs.org/user_builds/aquafetch/checkouts/latest/aqua_fetch/wq/_quadica.py:145: UserWarning: Could not infer format, so each element will be parsed individually, falling back to `dateutil`. To ensure parsing is consistent and as-expected, please specify a format.
wrtds.index = pd.to_datetime(wrtds['Year'].astype(str) + ' ' + wrtds['Month'].astype(str))
/home/docs/checkouts/readthedocs.org/user_builds/aquafetch/checkouts/latest/aqua_fetch/wq/_quadica.py:304: UserWarning: Could not infer format, so each element will be parsed individually, falling back to `dateutil`. To ensure parsing is consistent and as-expected, please specify a format.
temp.index = pd.to_datetime(temp.index)
/home/docs/checkouts/readthedocs.org/user_builds/aquafetch/checkouts/latest/aqua_fetch/wq/_quadica.py:351: UserWarning: Could not infer format, so each element will be parsed individually, falling back to `dateutil`. To ensure parsing is consistent and as-expected, please specify a format.
pcp.index = pd.to_datetime(pcp.index)
(29484, 33)
/home/docs/checkouts/readthedocs.org/user_builds/aquafetch/checkouts/latest/aqua_fetch/wq/_quadica.py:255: UserWarning: Could not infer format, so each element will be parsed individually, falling back to `dateutil`. To ensure parsing is consistent and as-expected, please specify a format.
pet.index = pd.to_datetime(pet.index)
[15]:
dyn['OBJECTID'].unique()
[15]:
array(['1011', '1016', '1017', '1019', '1082', '1113', '1186', '1237',
'1238', '1255', '1270', '1271', '1275', '1287', '1303', '1332',
'1467', '1473', '1482', '1495', '1570', '1571', '1573', '1672',
'1677', '1678', '1679', '1680', '1683', '1688', '1690', '1691',
'333', '334', '335', '336', '337', '340', '341', '342', '345',
'346', '347', '348', '349', '350', '352', '355', '358', '359',
'360', '362', '363', '364', '365', '368', '370', '373', '374',
'376', '380', '381', '391', '393', '637', '663', '667', '673',
'678', '686', '687', '688', '690', '692', '696', '701', '705',
'711', '716', '718', '722', '723', '728', '730', '734', '735',
'736', '737', '739', '740', '742', '744', '745', '746', '750',
'752', '754', '769', '773', '774', '775', '776', '778', '782',
'783', '785', '786', '787', '789', '796', '797', '874', '885',
'899', '985', '986', '991'], dtype=object)
[16]:
print(dyn.columns)
Index(['mean_FNFlux_DOC', 'mean_FNFlux_NO3', 'mean_FNFlux_TOC',
'median_FNC_NO3', 'mean_FNFlux_NMin', 'mean_FNFlux_TN', 'median_Q',
'median_C_NO3', 'median_FNC_TN', 'median_FNC_DOC', 'median_FNC_TOC',
'mean_Flux_PO4', 'median_C_NMin', 'median_C_PO4', 'mean_Flux_TP',
'mean_Flux_TOC', 'median_FNC_NMin', 'median_FNC_TP', 'mean_Flux_NO3',
'mean_FNFlux_TP', 'median_C_TN', 'median_FNC_PO4', 'median_C_TP',
'mean_FNFlux_PO4', 'mean_Flux_TN', 'mean_Flux_DOC', 'median_C_TOC',
'median_C_DOC', 'mean_Flux_NMin', 'OBJECTID', 'avg_temp', 'precip',
'pet'],
dtype='object')
[17]:
print(dyn.isna().sum())
mean_FNFlux_DOC 16361
mean_FNFlux_NO3 2709
mean_FNFlux_TOC 15469
median_FNC_NO3 2709
mean_FNFlux_NMin 9161
mean_FNFlux_TN 18880
median_Q 13
median_C_NO3 2691
median_FNC_TN 18880
median_FNC_DOC 16361
median_FNC_TOC 15469
mean_Flux_PO4 1988
median_C_NMin 9161
median_C_PO4 1988
mean_Flux_TP 1819
mean_Flux_TOC 15456
median_FNC_NMin 9161
median_FNC_TP 1819
mean_Flux_NO3 2691
mean_FNFlux_TP 1819
median_C_TN 18880
median_FNC_PO4 1988
median_C_TP 1819
mean_FNFlux_PO4 1988
mean_Flux_TN 18880
mean_Flux_DOC 16361
median_C_TOC 15456
median_C_DOC 16361
mean_Flux_NMin 9161
OBJECTID 0
avg_temp 0
precip 0
pet 0
dtype: int64
[18]:
print(cat.shape)
(29484, 112)
monthly TN
/home/docs/checkouts/readthedocs.org/user_builds/aquafetch/checkouts/latest/aqua_fetch/wq/_quadica.py:145: UserWarning: Could not infer format, so each element will be parsed individually, falling back to `dateutil`. To ensure parsing is consistent and as-expected, please specify a format.
wrtds.index = pd.to_datetime(wrtds['Year'].astype(str) + ' ' + wrtds['Month'].astype(str))
/home/docs/checkouts/readthedocs.org/user_builds/aquafetch/checkouts/latest/aqua_fetch/wq/_quadica.py:304: UserWarning: Could not infer format, so each element will be parsed individually, falling back to `dateutil`. To ensure parsing is consistent and as-expected, please specify a format.
temp.index = pd.to_datetime(temp.index)
/home/docs/checkouts/readthedocs.org/user_builds/aquafetch/checkouts/latest/aqua_fetch/wq/_quadica.py:351: UserWarning: Could not infer format, so each element will be parsed individually, falling back to `dateutil`. To ensure parsing is consistent and as-expected, please specify a format.
pcp.index = pd.to_datetime(pcp.index)
(6300, 9)
/home/docs/checkouts/readthedocs.org/user_builds/aquafetch/checkouts/latest/aqua_fetch/wq/_quadica.py:255: UserWarning: Could not infer format, so each element will be parsed individually, falling back to `dateutil`. To ensure parsing is consistent and as-expected, please specify a format.
pet.index = pd.to_datetime(pet.index)
[20]:
dyn.head()
[20]:
| mean_Flux_TN | mean_FNFlux_TN | median_Q | median_FNC_TN | median_C_TN | OBJECTID | avg_temp | precip | pet | |
|---|---|---|---|---|---|---|---|---|---|
| 1993-01-01 | 15385.732237 | 15231.802979 | 26.830 | 6.146777 | 6.031168 | 1016 | 3.522219 | 87.729192 | 13.233763 |
| 1993-02-01 | 9013.965119 | 13883.296467 | 14.915 | 6.063398 | 6.683056 | 1016 | -0.751842 | 17.499132 | 11.923154 |
| 1993-03-01 | 6399.883526 | 12208.820505 | 10.550 | 5.916351 | 6.875362 | 1016 | 4.395708 | 9.086743 | 46.873238 |
| 1993-04-01 | 5857.966285 | 8862.132520 | 10.090 | 5.791805 | 6.473212 | 1016 | 10.420328 | 34.628064 | 82.216114 |
| 1993-05-01 | 6134.053878 | 6973.986038 | 10.480 | 5.683456 | 6.021999 | 1016 | 13.843144 | 100.724108 | 112.228591 |
[21]:
dyn.tail()
[21]:
| mean_Flux_TN | mean_FNFlux_TN | median_Q | median_FNC_TN | median_C_TN | OBJECTID | avg_temp | precip | pet | |
|---|---|---|---|---|---|---|---|---|---|
| 2013-08-01 | 596.596256 | 868.456700 | 2.70 | 2.638713 | 2.538385 | 991 | 17.427514 | 46.309400 | 112.389357 |
| 2013-09-01 | 581.025792 | 900.594832 | 2.55 | 2.688586 | 2.550167 | 991 | 13.039871 | 71.339231 | 59.626034 |
| 2013-10-01 | 835.206639 | 1175.224141 | 3.42 | 2.941018 | 2.895106 | 991 | 11.067293 | 78.249183 | 31.262571 |
| 2013-11-01 | 1529.151146 | 1895.196572 | 4.77 | 3.445098 | 3.376280 | 991 | 5.443935 | 63.361708 | 11.133313 |
| 2013-12-01 | 2669.605407 | 2958.770365 | 7.43 | 3.918537 | 3.973231 | 991 | 4.831621 | 71.560471 | 7.538275 |
[22]:
print(dyn.isna().sum())
mean_Flux_TN 0
mean_FNFlux_TN 0
median_Q 0
median_FNC_TN 0
median_C_TN 0
OBJECTID 0
avg_temp 0
precip 0
pet 0
dtype: int64
[23]:
dyn['OBJECTID'].unique()
[23]:
array(['1016', '1017', '1019', '663', '673', '678', '686', '687', '688',
'690', '728', '730', '734', '744', '745', '746', '750', '754',
'782', '783', '785', '786', '985', '986', '991'], dtype=object)
[24]:
print(len(dyn['OBJECTID'].unique()))
25
[25]:
print(cat.shape)
(6300, 112)
[26]:
df = pd.concat([grp['median_C_TN'] for idx,grp in dyn.groupby('OBJECTID')], axis=1)
df.columns = dyn['OBJECTID'].unique()
ridge(df, figsize=(10, 10), color="GnBu", title="median_C_TN")
[26]:
[<Axes: >,
<Axes: >,
<Axes: >,
<Axes: >,
<Axes: >,
<Axes: >,
<Axes: >,
<Axes: >,
<Axes: >,
<Axes: >,
<Axes: >,
<Axes: >,
<Axes: >,
<Axes: >,
<Axes: >,
<Axes: >,
<Axes: >,
<Axes: >,
<Axes: >,
<Axes: >,
<Axes: >,
<Axes: >,
<Axes: >,
<Axes: >,
<Axes: >]
monthly TP
/home/docs/checkouts/readthedocs.org/user_builds/aquafetch/checkouts/latest/aqua_fetch/wq/_quadica.py:145: UserWarning: Could not infer format, so each element will be parsed individually, falling back to `dateutil`. To ensure parsing is consistent and as-expected, please specify a format.
wrtds.index = pd.to_datetime(wrtds['Year'].astype(str) + ' ' + wrtds['Month'].astype(str))
/home/docs/checkouts/readthedocs.org/user_builds/aquafetch/checkouts/latest/aqua_fetch/wq/_quadica.py:304: UserWarning: Could not infer format, so each element will be parsed individually, falling back to `dateutil`. To ensure parsing is consistent and as-expected, please specify a format.
temp.index = pd.to_datetime(temp.index)
/home/docs/checkouts/readthedocs.org/user_builds/aquafetch/checkouts/latest/aqua_fetch/wq/_quadica.py:351: UserWarning: Could not infer format, so each element will be parsed individually, falling back to `dateutil`. To ensure parsing is consistent and as-expected, please specify a format.
pcp.index = pd.to_datetime(pcp.index)
(21420, 9)
/home/docs/checkouts/readthedocs.org/user_builds/aquafetch/checkouts/latest/aqua_fetch/wq/_quadica.py:255: UserWarning: Could not infer format, so each element will be parsed individually, falling back to `dateutil`. To ensure parsing is consistent and as-expected, please specify a format.
pet.index = pd.to_datetime(pet.index)
[28]:
dyn['OBJECTID'].unique()
[28]:
array(['1016', '1017', '1019', '1082', '1113', '1186', '1271', '1275',
'1570', '1571', '1573', '1677', '1678', '1680', '1683', '334',
'335', '336', '337', '340', '341', '342', '345', '347', '350',
'352', '355', '358', '359', '360', '362', '363', '364', '365',
'368', '370', '374', '376', '380', '381', '391', '663', '673',
'678', '686', '687', '688', '690', '692', '696', '701', '705',
'711', '716', '718', '722', '723', '728', '730', '734', '735',
'736', '737', '739', '740', '742', '744', '745', '746', '750',
'754', '769', '773', '776', '778', '782', '783', '785', '786',
'874', '885', '899', '985', '986', '991'], dtype=object)
[29]:
print(len(dyn['OBJECTID'].unique()))
85
[30]:
dyn.head()
[30]:
| median_C_TP | median_FNC_TP | median_Q | mean_FNFlux_TP | mean_Flux_TP | OBJECTID | avg_temp | precip | pet | |
|---|---|---|---|---|---|---|---|---|---|
| 1993-01-01 | 0.250841 | 0.264840 | 26.830 | 729.450441 | 708.978059 | 1016 | 3.522219 | 87.729192 | 13.233763 |
| 1993-02-01 | 0.276256 | 0.252750 | 14.915 | 598.592187 | 371.334647 | 1016 | -0.751842 | 17.499132 | 11.923154 |
| 1993-03-01 | 0.317533 | 0.259186 | 10.550 | 540.657572 | 292.704292 | 1016 | 4.395708 | 9.086743 | 46.873238 |
| 1993-04-01 | 0.340756 | 0.288951 | 10.090 | 435.010108 | 305.748890 | 1016 | 10.420328 | 34.628064 | 82.216114 |
| 1993-05-01 | 0.359759 | 0.336200 | 10.480 | 403.209077 | 361.870561 | 1016 | 13.843144 | 100.724108 | 112.228591 |
[31]:
dyn.tail()
[31]:
| median_C_TP | median_FNC_TP | median_Q | mean_FNFlux_TP | mean_Flux_TP | OBJECTID | avg_temp | precip | pet | |
|---|---|---|---|---|---|---|---|---|---|
| 2013-08-01 | 0.106069 | 0.115998 | 2.70 | 41.111437 | 24.963891 | 991 | 17.427514 | 46.309400 | 112.389357 |
| 2013-09-01 | 0.101192 | 0.111201 | 2.55 | 39.240604 | 23.158398 | 991 | 13.039871 | 71.339231 | 59.626034 |
| 2013-10-01 | 0.111296 | 0.114864 | 3.42 | 47.904513 | 32.025155 | 991 | 11.067293 | 78.249183 | 31.262571 |
| 2013-11-01 | 0.126029 | 0.129910 | 4.77 | 73.404061 | 57.209615 | 991 | 5.443935 | 63.361708 | 11.133313 |
| 2013-12-01 | 0.143431 | 0.144230 | 7.43 | 110.040862 | 96.120649 | 991 | 4.831621 | 71.560471 | 7.538275 |
[32]:
print(dyn.isna().sum())
median_C_TP 0
median_FNC_TP 0
median_Q 0
mean_FNFlux_TP 0
mean_Flux_TP 0
OBJECTID 0
avg_temp 0
precip 0
pet 0
dtype: int64
[33]:
print(cat.shape)
(21420, 112)
monthly TOC
/home/docs/checkouts/readthedocs.org/user_builds/aquafetch/checkouts/latest/aqua_fetch/wq/_quadica.py:145: UserWarning: Could not infer format, so each element will be parsed individually, falling back to `dateutil`. To ensure parsing is consistent and as-expected, please specify a format.
wrtds.index = pd.to_datetime(wrtds['Year'].astype(str) + ' ' + wrtds['Month'].astype(str))
/home/docs/checkouts/readthedocs.org/user_builds/aquafetch/checkouts/latest/aqua_fetch/wq/_quadica.py:304: UserWarning: Could not infer format, so each element will be parsed individually, falling back to `dateutil`. To ensure parsing is consistent and as-expected, please specify a format.
temp.index = pd.to_datetime(temp.index)
/home/docs/checkouts/readthedocs.org/user_builds/aquafetch/checkouts/latest/aqua_fetch/wq/_quadica.py:351: UserWarning: Could not infer format, so each element will be parsed individually, falling back to `dateutil`. To ensure parsing is consistent and as-expected, please specify a format.
pcp.index = pd.to_datetime(pcp.index)
(5796, 9)
/home/docs/checkouts/readthedocs.org/user_builds/aquafetch/checkouts/latest/aqua_fetch/wq/_quadica.py:255: UserWarning: Could not infer format, so each element will be parsed individually, falling back to `dateutil`. To ensure parsing is consistent and as-expected, please specify a format.
pet.index = pd.to_datetime(pet.index)
[35]:
dyn['OBJECTID'].unique()
[35]:
array(['1016', '1019', '1473', '1482', '1570', '1571', '1573', '1677',
'1678', '1680', '1683', '1688', '1690', '352', '355', '358', '359',
'370', '374', '796', '797', '985', '991'], dtype=object)
[36]:
23
[37]:
df = pd.concat([grp['median_C_TOC'] for idx,grp in dyn.groupby('OBJECTID')], axis=1)
df.columns = dyn['OBJECTID'].unique()
ridge(df, figsize=(10, 10), color="GnBu", title="median_C_TOC")
[37]:
[<Axes: >,
<Axes: >,
<Axes: >,
<Axes: >,
<Axes: >,
<Axes: >,
<Axes: >,
<Axes: >,
<Axes: >,
<Axes: >,
<Axes: >,
<Axes: >,
<Axes: >,
<Axes: >,
<Axes: >,
<Axes: >,
<Axes: >,
<Axes: >,
<Axes: >,
<Axes: >,
<Axes: >,
<Axes: >,
<Axes: >]
[38]:
dyn.head()
[38]:
| median_FNC_TOC | mean_FNFlux_TOC | median_C_TOC | median_Q | mean_Flux_TOC | OBJECTID | avg_temp | precip | pet | |
|---|---|---|---|---|---|---|---|---|---|
| 1993-01-01 | 4.369830 | 14157.612115 | 4.212516 | 26.830 | 13574.522004 | 1016 | 3.522219 | 87.729192 | 13.233763 |
| 1993-02-01 | 4.062978 | 11312.971228 | 3.728177 | 14.915 | 5151.380413 | 1016 | -0.751842 | 17.499132 | 11.923154 |
| 1993-03-01 | 4.044296 | 9943.530417 | 3.728456 | 10.550 | 3485.207419 | 1016 | 4.395708 | 9.086743 | 46.873238 |
| 1993-04-01 | 4.197412 | 6998.987771 | 4.031031 | 10.090 | 3646.801855 | 1016 | 10.420328 | 34.628064 | 82.216114 |
| 1993-05-01 | 4.478295 | 6128.825892 | 4.421674 | 10.480 | 4845.934057 | 1016 | 13.843144 | 100.724108 | 112.228591 |
[39]:
dyn.tail()
[39]:
| median_FNC_TOC | mean_FNFlux_TOC | median_C_TOC | median_Q | mean_Flux_TOC | OBJECTID | avg_temp | precip | pet | |
|---|---|---|---|---|---|---|---|---|---|
| 2013-08-01 | 9.780485 | 3631.592594 | 8.657503 | 2.70 | 2051.167867 | 991 | 17.427514 | 46.309400 | 112.389357 |
| 2013-09-01 | 10.124471 | 3782.986075 | 8.610587 | 2.55 | 1987.743880 | 991 | 13.039871 | 71.339231 | 59.626034 |
| 2013-10-01 | 11.019640 | 4882.642291 | 10.367034 | 3.42 | 2995.745601 | 991 | 11.067293 | 78.249183 | 31.262571 |
| 2013-11-01 | 12.917707 | 7789.730463 | 12.272105 | 4.77 | 5698.008879 | 991 | 5.443935 | 63.361708 | 11.133313 |
| 2013-12-01 | 13.924602 | 11295.747400 | 14.007187 | 7.43 | 9682.088520 | 991 | 4.831621 | 71.560471 | 7.538275 |
[40]:
print(dyn.isna().sum())
median_FNC_TOC 0
mean_FNFlux_TOC 0
median_C_TOC 0
median_Q 0
mean_Flux_TOC 0
OBJECTID 0
avg_temp 0
precip 0
pet 0
dtype: int64
[41]:
print(cat.shape)
(5796, 112)
monthly DOC
/home/docs/checkouts/readthedocs.org/user_builds/aquafetch/checkouts/latest/aqua_fetch/wq/_quadica.py:145: UserWarning: Could not infer format, so each element will be parsed individually, falling back to `dateutil`. To ensure parsing is consistent and as-expected, please specify a format.
wrtds.index = pd.to_datetime(wrtds['Year'].astype(str) + ' ' + wrtds['Month'].astype(str))
/home/docs/checkouts/readthedocs.org/user_builds/aquafetch/checkouts/latest/aqua_fetch/wq/_quadica.py:304: UserWarning: Could not infer format, so each element will be parsed individually, falling back to `dateutil`. To ensure parsing is consistent and as-expected, please specify a format.
temp.index = pd.to_datetime(temp.index)
/home/docs/checkouts/readthedocs.org/user_builds/aquafetch/checkouts/latest/aqua_fetch/wq/_quadica.py:351: UserWarning: Could not infer format, so each element will be parsed individually, falling back to `dateutil`. To ensure parsing is consistent and as-expected, please specify a format.
pcp.index = pd.to_datetime(pcp.index)
(6804, 9)
/home/docs/checkouts/readthedocs.org/user_builds/aquafetch/checkouts/latest/aqua_fetch/wq/_quadica.py:255: UserWarning: Could not infer format, so each element will be parsed individually, falling back to `dateutil`. To ensure parsing is consistent and as-expected, please specify a format.
pet.index = pd.to_datetime(pet.index)
[43]:
dyn['OBJECTID'].unique()
[43]:
array(['1016', '1017', '1019', '1082', '1271', '663', '678', '690', '696',
'701', '705', '711', '718', '722', '723', '728', '734', '744',
'745', '746', '750', '754', '776', '782', '783', '785', '786'],
dtype=object)
[44]:
print(len(dyn['OBJECTID'].unique()))
27
[45]:
dyn.head()
[45]:
| median_FNC_DOC | mean_FNFlux_DOC | mean_Flux_DOC | median_Q | median_C_DOC | OBJECTID | avg_temp | precip | pet | |
|---|---|---|---|---|---|---|---|---|---|
| 1993-01-01 | 4.422908 | 14746.595522 | 14034.419176 | 26.830 | 4.263823 | 1016 | 3.522219 | 87.729192 | 13.233763 |
| 1993-02-01 | 4.151962 | 11863.883605 | 5267.981150 | 14.915 | 3.819951 | 1016 | -0.751842 | 17.499132 | 11.923154 |
| 1993-03-01 | 4.057110 | 10704.012637 | 3433.955020 | 10.550 | 3.688297 | 1016 | 4.395708 | 9.086743 | 46.873238 |
| 1993-04-01 | 4.038146 | 6688.173272 | 3461.362674 | 10.090 | 3.828360 | 1016 | 10.420328 | 34.628064 | 82.216114 |
| 1993-05-01 | 4.142562 | 5564.030457 | 4471.200985 | 10.480 | 4.057443 | 1016 | 13.843144 | 100.724108 | 112.228591 |
[46]:
dyn.tail()
[46]:
| median_FNC_DOC | mean_FNFlux_DOC | mean_Flux_DOC | median_Q | median_C_DOC | OBJECTID | avg_temp | precip | pet | |
|---|---|---|---|---|---|---|---|---|---|
| 2013-08-01 | 3.185052 | 1104.605608 | 695.156677 | 3.0620 | 2.557519 | 786 | 17.966228 | 39.341122 | 118.449632 |
| 2013-09-01 | 3.222788 | 1160.244409 | 767.811400 | 3.3355 | 2.661074 | 786 | 13.281095 | 66.205910 | 59.288903 |
| 2013-10-01 | 3.185955 | 1197.565692 | 1096.453981 | 3.7390 | 2.836283 | 786 | 11.044072 | 77.306382 | 33.423185 |
| 2013-11-01 | 3.527299 | 1493.351442 | 1097.124559 | 3.7710 | 2.764579 | 786 | 5.263868 | 62.294622 | 12.376870 |
| 2013-12-01 | 3.935583 | 1920.445979 | 1329.661671 | 3.9930 | 2.826071 | 786 | 4.765950 | 58.713828 | 8.326679 |
[47]:
print(dyn.isna().sum())
median_FNC_DOC 0
mean_FNFlux_DOC 0
mean_Flux_DOC 0
median_Q 0
median_C_DOC 0
OBJECTID 0
avg_temp 0
precip 0
pet 0
dtype: int64
[48]:
print(cat.shape)
(6804, 112)