ef90233e8a378c3049cb6955ba88f6598dc545d0,examples/plotting/file/texas.py,,,#,7

Before Change


county_names = []
county_rates = []
for county_id in us_counties.data:
    if us_counties.data[county_id]["state"] != state:
        continue
    rate = unemployment.data[county_id]
    idx = min(int(rate/2), 5)
    county_colors.append(colors[idx])
    county_names.append(us_counties.data[county_id]["name"])
    county_rates.append(rate)

After Change


from bokeh.sampledata.unemployment import data as unemployment

counties = {
    code: county for code, county in counties.items() if county["state"] == "tx"
}

county_xs = [county["lons"] for county in counties.values()]
county_ys = [county["lats"] for county in counties.values()]

colors = ["//F1EEF6", "//D4B9DA", "//C994C7", "//DF65B0", "//DD1C77", "/�"]

county_names = [county["name"] for county in counties.values()]
county_rates = [unemployment[county_id] for county_id in counties]
county_colors = [colors[int(rate/3)] for rate in county_rates]

source = ColumnDataSource(data=dict(
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 8

Instances


Project Name: bokeh/bokeh
Commit Name: ef90233e8a378c3049cb6955ba88f6598dc545d0
Time: 2015-12-22
Author: bryanv@continuum.io
File Name: examples/plotting/file/texas.py
Class Name:
Method Name:


Project Name: elbayadm/attn2d
Commit Name: cf1c64a5f7cffe7a362cc772752f8f226fb04f22
Time: 2018-06-15
Author: myleott@fb.com
File Name: train.py
Class Name:
Method Name: validate