Skip to content

eds_scikit.structures.description

add_care_site_description

add_care_site_description(care_site: DataFrame) -> DataFrame

Add column DESCRIPTION to care_site dataframe.

This algo applies simple regular expression to simplify the care site name. This can be useful for post-processing the description, such as detecting the care_site characteristic from the description (is it an emergency care site ?)

PARAMETER DESCRIPTION
care_site

with column care_site_name

TYPE: DataFrame

RETURNS DESCRIPTION
care_site

contains additional column DESCRIPTION

TYPE: DataFrame

Source code in eds_scikit/structures/description.py
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
@concept_checker(concepts=["DESCRIPTION"])
def add_care_site_description(care_site: DataFrame) -> DataFrame:
    """Add column ``DESCRIPTION`` to care_site dataframe.

    This algo applies simple regular expression to simplify the care site name.
    This can be useful for post-processing the description, such as detecting
    the care_site characteristic from the description (is it an emergency care site ?)

    Parameters
    ----------
    care_site : DataFrame
        with column ``care_site_name``


    Returns
    -------
    care_site : DataFrame
        contains additional column ``DESCRIPTION``

    """
    care_site = care_site.assign(
        DESCRIPTION=description_from_care_site_name(care_site["care_site_name"])
    )
    return care_site
Back to top