bucky.viz.geoid

Creates lookup tables relating geographic administrative divisions for use in visualization tools.

Module Contents

Functions

read_geoid_from_graph(graph_file=None)

Creates a dataframe relating geographic administration levels, e.g. admin2 values in a given admin1.

read_lookup(geofile, country='US')

Creates a dataframe relating geographic admin levels e.g. admin2 values in an admin1 based on a lookup table.

bucky.viz.geoid.read_geoid_from_graph(graph_file=None)[source]

Creates a dataframe relating geographic administration levels, e.g. admin2 values in a given admin1.

Parameters

graph_file (str, or None) – Location of graph file. If None, uses most recently created graph in data/input_graphs/.

Returns

df – Dataframe with names and values for admin0, admin1, and admin2 levels.

Return type

pandas.DataFrame

bucky.viz.geoid.read_lookup(geofile, country='US')[source]

Creates a dataframe relating geographic admin levels e.g. admin2 values in an admin1 based on a lookup table.

Parameters
  • geofile (str) – Location of lookup table

  • country (str, optional) – Country name

Returns

df – Dataframe with names and values for admin0, admin1, and admin2

Return type

pandas.DataFrame