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: 6

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: scikit-learn-contrib/categorical-encoding
Commit Name: be4714db73202347a07044f2e26920e0da95fff3
Time: 2019-03-23
Author: datarian@againstthecurrent.ch
File Name: category_encoders/basen.py
Class Name: BaseNEncoder
Method Name: basen_to_integer


Project Name: scikit-learn-contrib/categorical-encoding
Commit Name: edac1ed27ba8a4db58f526af053d6cd2b4f50497
Time: 2019-03-22
Author: datarian@againstthecurrent.ch
File Name: category_encoders/basen.py
Class Name: BaseNEncoder
Method Name: basen_to_integer