@@ -1747,7 +1747,7 @@ def get_samples(
17471747
17481748 return df , BaseMetadata (response )
17491749
1750- def get_por_stats (
1750+ def get_stats_por (
17511751 approval_status : Optional [str ] = None ,
17521752 computation_type : Optional [Union [str , list [str ]]] = None ,
17531753 country_code : Optional [Union [str , list [str ]]] = None ,
@@ -1828,17 +1828,26 @@ def get_por_stats(
18281828 thresholds in the "values" and "percentiles" columns, respectively.
18291829 When `expand_percentiles` is set to True (default), each value and
18301830 percentile threshold specific to a computation id are returned as
1831- individual rows in the dataframe. Missing percentile values expressed
1832- as 'nan' in the list of string values are removed from the dataframe
1833- to save space.
1831+ individual rows in the dataframe, with the value reported in the
1832+ "value" column and the corresponding percentile reported in a
1833+ "percentile" column (and the "values" and "percentiles" columns
1834+ are removed). Missing percentile values expressed as 'nan' in the
1835+ list of string values are removed from the dataframe to save space.
1836+ Setting `expand_percentiles` to False retains the "values" and
1837+ "percentiles" columns produced by the service. Including
1838+ both 'percentiles' and one or more other statistics ('median',
1839+ 'minimum', 'maximum', or 'arithmetic_mean') in the `computation_type`
1840+ argument will return both the "values" column, containing the list
1841+ of percentile threshold values, and a "value" column, containing
1842+ the singular summary value for the other statistics.
18341843
18351844 Examples
18361845 --------
18371846 .. code::
18381847
18391848 >>> # Get daily, monthly, and annual percentiles for streamflow at
18401849 >>> # a monitoring location of interest
1841- >>> df, md = dataretrieval.waterdata.get_por_stats (
1850+ >>> df, md = dataretrieval.waterdata.get_stats_por (
18421851 ... monitoring_location_id="USGS-05114000",
18431852 ... parameter_code="00060",
18441853 ... computation_type="percentile"
@@ -1847,7 +1856,7 @@ def get_por_stats(
18471856 >>> # Get all daily and monthly statistics for the month of January
18481857 >>> # over the entire period of record for streamflow and gage height
18491858 >>> # at a monitoring location of interest
1850- >>> df, md = dataretrieval.waterdata.get_por_stats (
1859+ >>> df, md = dataretrieval.waterdata.get_stats_por (
18511860 ... monitoring_location_id="USGS-05114000",
18521861 ... parameter_code=["00060", "00065"],
18531862 ... start_date="01-01",
@@ -1866,7 +1875,7 @@ def get_por_stats(
18661875 expand_percentiles = expand_percentiles
18671876 )
18681877
1869- def get_date_range_stats (
1878+ def get_stats_date_range (
18701879 approval_status : Optional [str ] = None ,
18711880 computation_type : Optional [Union [str , list [str ]]] = None ,
18721881 country_code : Optional [Union [str , list [str ]]] = None ,
@@ -1948,17 +1957,26 @@ def get_date_range_stats(
19481957 thresholds in the "values" and "percentiles" columns, respectively.
19491958 When `expand_percentiles` is set to True (default), each value and
19501959 percentile threshold specific to a computation id are returned as
1951- individual rows in the dataframe. Missing percentile values expressed
1952- as 'nan' in the list of string values are removed from the dataframe
1953- to save space.
1960+ individual rows in the dataframe, with the value reported in the
1961+ "value" column and the corresponding percentile reported in a
1962+ "percentile" column (and the "values" and "percentiles" columns
1963+ are removed). Missing percentile values expressed as 'nan' in the
1964+ list of string values are removed from the dataframe to save space.
1965+ Setting `expand_percentiles` to False retains the "values" and
1966+ "percentiles" columns produced by the service. Including
1967+ both 'percentiles' and one or more other statistics ('median',
1968+ 'minimum', 'maximum', or 'arithmetic_mean') in the `computation_type`
1969+ argument will return both the "values" column, containing the list
1970+ of percentile threshold values, and a "value" column, containing
1971+ the singular summary value for the other statistics.
19541972
19551973 Examples
19561974 --------
19571975 .. code::
19581976
19591977 >>> # Get monthly and yearly medians for streamflow at streams in Rhode Island
19601978 >>> # from calendar year 2024.
1961- >>> df, md = dataretrieval.waterdata.get_date_range_stats (
1979+ >>> df, md = dataretrieval.waterdata.get_stats_date_range (
19621980 ... state_code="US:44", # State code for Rhode Island
19631981 ... parameter_code="00060",
19641982 ... site_type_code="ST",
@@ -1969,7 +1987,7 @@ def get_date_range_stats(
19691987
19701988 >>> # Get monthly and yearly minimum and maximums for gage height at
19711989 >>> # a monitoring location of interest
1972- >>> df, md = dataretrieval.waterdata.get_date_range_stats (
1990+ >>> df, md = dataretrieval.waterdata.get_stats_date_range (
19731991 ... monitoring_location_id="USGS-05114000",
19741992 ... parameter_code="00065",
19751993 ... computation_type=["minimum", "maximum"]
0 commit comments