2f045e23607f4660d3920d6a91e322311516d6d6,examples/plotting/file/unemployment.py,,,#,8

Before Change


from bokeh.plotting import figure
from bokeh.sampledata.unemployment1948 import data

data["Year"] = [str(x) for x in data["Year"]]

years = list(data["Year"])
months = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]

data = data.set_index("Year")

// this is the colormap from the original NYTimes plot
colors = ["/�f", "//a5bab7", "//c9d9d3", "//e2e2e2", "//dfccce", "//ddb7b1", "//cc7878", "/묽b41", "/릾b1d"]
mapper = LinearColorMapper(palette=colors)
// Set up the data for plotting. We will need to have values for every
// pair of year/month names. Map the rate to a color.
month = []
year = []
color = []
rate = []
for y in years:
    for m in months:
        month.append(m)
        year.append(y)
        monthly_rate = data[m][y]
        rate.append(monthly_rate)

source = ColumnDataSource(
    data=dict(month=month, year=year, rate=rate)
)

After Change



data["Year"] = data["Year"].astype(str)
data = data.set_index("Year")
data.drop("Annual", axis=1, inplace=True)
data.columns.name = "Month"

years = list(data.index)
months = list(data.columns)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


Project Name: bokeh/bokeh
Commit Name: 2f045e23607f4660d3920d6a91e322311516d6d6
Time: 2017-03-29
Author: jsignell@gmail.com
File Name: examples/plotting/file/unemployment.py
Class Name:
Method Name:


Project Name: metagenome-atlas/atlas
Commit Name: 3ab0e54a3ce88c7018a34192461dd47e5867d357
Time: 2017-01-28
Author: joe.brown@pnnl.gov
File Name: atlas/tables.py
Class Name:
Method Name: col_split


Project Name: ScottfreeLLC/AlphaPy
Commit Name: 0bd0e2dc1a41966ed811a5643e60971656874d8f
Time: 2016-05-04
Author: Mark.R.Conway@gmail.com
File Name: features.py
Class Name:
Method Name: drop_features