GeoEncoder

class rsdiv.encoding.GeoEncoder[source]

Bases: BaseEncoder

Plotly Sample Datasets.

read_source() Tuple[DataFrame, Dict][source]

Parse the location information from geojson-counties-fips.json.

Returns

dataframe and county-wise dictionary.

Return type

Tuple[pd.DataFrame, Dict]

encoding_single(org: Union[List, str]) Union[int, str][source]

Encoding for a single location.

Parameters

org (Union[List, str]) – location to be encoded.

Returns

the coding corresponds to the given target.

Return type

Union[int, str]

encoding_series(series: Series) Series[source]

Encoding for the series of locations.

Parameters

series (pd.Series) – ths series of locations.

Returns

the corresponding series of locations.

Return type

pd.Series

draw_geo_graph(dataframe: DataFrame, source_name: str, hover_name: Optional[str] = None) None[source]

Method to indicate the values in a geography view.

Parameters
  • dataframe (pd.DataFrame) – data source.

  • source_name (str) – the name of column for target data.

  • hover_name (Optional[str], optional) – the name of column for hovering labels. Defaults to None.