watex.utils.get_unique_section#
- watex.utils.get_unique_section(*data, zname, kname, return_index=False, return_data=False, error='raise', **kws)[source]#
Get the section to consider unique in multiple aquifers.
The unique section ‘upper’ and ‘lower’ is the valid range of the whole sections of each aquifers. It is considered as the main valid section from which data can not be compressed and not altered. For instance, the use of indexes is necessary to shrunk the data except this valid section. Mosly the data from the section is considered the valid data as the predictor Xr. Out of the range of aquifers ection, data can be discarded or compressed to top Xr.
Returns valid section indexes if ‘return_index’ is set to
True.- Parameters:
d (list of pandas dataframe) – Data that contains mainly the aquifer values. It needs to specify the name of the depth column zname as well as the name of permeabiliy kname column.
zname (str, int) – Name of depth columns. zname allows to retrieve the depth column in a dataframe. If integer is passed, it assumes the index of the dataframe fits the depth column. Integer value must not be out the dataframe size along axis 1. Commonly `zname`needs to be supplied when a dataframe is passed to a function argument.
kname (str, int) –
- Name of permeability coefficient columns. kname allows to retrieve the
permeability coefficient ‘k’ in a specific dataframe. If integer is passed, it assumes the index of the dataframe fits the ‘k’ columns. Note that integer value must not be out the dataframe size along axis 1. Commonly
- kname needs to be supplied when a dataframe is passed as a positional
or keyword argument.
z (array-like 1d, pandas.Series) – Array of depth or a pandas series that contains the depth values. Two dimensional array or more is not allowed. However when z is given as a dataframe and zname is not supplied, an error raises since zname is used to fetch and overwritten z from the dataframe.
return_index (bool, default =False ,) – Returns the positions (indexes) of the upper and lower sections of the shallower and deep aquifers found in the whole dataframes.
return_data (bool, default=False,) – Return valid data. It is usefull when ‘error’ is set to ‘ignore’ to collect the valid data.
error (str, default='raise') – Raise errors if trouble occurs when computing the section of each aquifer. If ‘ignore’, a UserWarning is displayed when invalid data is found. Any other value of error will set error to raise.
kws (dict,) – Additional keywords arguments passed to
get_aquifer_sections().
- Returns:
up, low –
(upix, lowix ): Tuple of indexes of lower and upper sections
(up, low): Tuple of aquifer sections (upper and lower)
- (upix, lowix), (up, low)positions and sections values of aquifers
if return_index and return_sections` are
True.
- Return type:
list of upper and lower section values of aquifer.
See also
watex.utils.hydroutils.get_aquifer_sectioncompute single section
watex.utils.hydroutils.get_aquifer_sectionscompute multiple sections
Example
>>> from watex.datasets import load_hlogs >>> data = load_hlogs ().frame >>> get_unique_section (data.copy() , zname ='depth', kname ='k', ) ... array([197.12, 369.71], dtype=float32) >>> get_unique_sections (data.copy() , zname ='depth', kname ='k', return_index =True) ... array([16, 29])