Skip to content

transitlos.map.col_describe

Plain-English descriptions for map columns that have no real definition in a census schema.

describe_column(col, label, source) builds one sentence from the column's name pattern (election results, shares, rates, means, counts, ...) so every "i" button on the map has a text that says what the number is. is_weak(description, label) flags a stored description that only repeats the label.

describe_column(col, label, source='', logical=None)

One sentence saying what col (shown as label, from source) holds.

Parameters:

Name Type Description Default
col str

Column name.

required
label str

Display label.

required
source str

Dataset name.

''
logical Optional[str]

Column name without its source prefix.

None

Returns:

Type Description
str

The sentence.

is_weak(description, label)

True when description is empty, tiny or just the label again.

Parameters:

Name Type Description Default
description str

A description.

required
label str

The column's label.

required