In [24]:
#create interactive scatter chart showing distance of Jewish institutions from Capitol
import pandas as pd
syn = pd.read_csv('jewish_institutions.csv', names = ['congregation', 'year', 'distance'])

In [25]:
syn


Out[25]:
congregation year distance
0 Washington Hebrew Congregation 1863 1.713277
1 Washington Hebrew Congregation 1955 7.738767
2 Adas Israel Congregation 1876 1.326568
3 Adas Israel Congregation 1906 1.540310
4 Adas Israel Congregation 1951 6.466478
5 Ohev Sholom Talmud Torah 1893 1.060000
6 Ohev Sholom Talmud Torah 1906 1.488474
7 Ohev Sholom Talmud Torah 1951 8.658585
8 Ohev Sholom Talmud Torah 1960 10.739619
9 Ezras Israel Congregation 1907 1.718134
10 Ezras Israel Congregation 1959 9.624730
11 Ezras Israel Congregation 1978 21.300000
12 Southeast Hebrew Congregation 1922 1.501659
13 Southeast Hebrew Congregation 1971 16.140974
14 B'nai Israel Congregation 1925 6.627811
15 B'nai Israel Congregation 1929 6.973718
16 B'nai Israel Congregation 1951 6.792546
17 B'nai Israel Congregation 1976 20.938035
18 Tifereth Israel Congregation 1914 3.607892
19 Tifereth Israel Congregation 1925 4.261609
20 Tifereth Israel Congregation 1956 10.637888
21 Beth Sholom Congregation and Talmud Torah 1938 5.679402
22 Beth Sholom Congregation and Talmud Torah 1956 10.501095
23 Beth Sholom Congregation and Talmud Torah 1958 10.932356
24 Beth Sholom Congregation and Talmud Torah 1972 22.325642
25 Congregation Har Tzeon Agudath Achim 1940 8.356424
26 Congregation Har Tzeon Agudath Achim 1954 8.774329
27 Congregation Har Tzeon Agudath Achim 1958 8.816535
28 Congregation Har Tzeon Agudath Achim 1977 16.856510
29 Shaare Tefila Congregation 1954 7.702161
30 Shaare Tefila Congregation 1965 16.591886
31 Shaare Tefila Congregation 2011 27.081905
32 Temple Sinai 1952 7.144350
33 Temple Sinai 1957 9.133646
34 Temple Micah 1966 1.825651
35 Temple Micah 1995 6.910606
36 Hebrew Home for the Aged 1914 1.895379
37 Hebrew Home for the Aged 1924 1.895379
38 Jewish Social Service Agency 1940 5.451608
39 Jewish Social Service Agency 1969 20.723086
40 Jewish Community Center 1926 3.350016
41 Jewish Community Center 1969 3.350016
42 Jewish Community Center 1997 3.350016
43 Congregation Shaare Tikvah 1942 4.083638
44 Congregation Shaare Tikvah 1944 2.791841
45 Congregation Shaare Tikvah 1965 6.145343
46 Congregation Shaare Tikvah 1967 10.639617
47 6th and I 2004 1.520000
48 Hill Havurah 1998 0.530000

In [26]:
syn['year'] =  pd.to_datetime(syn['year'], format='%Y')
syn['time'] = syn['year'].dt.strftime('%Y')

In [27]:
from bokeh.charts import Scatter, output_notebook, show, output_file
from bokeh.models import Range1d
tooltips = [('name', '@congregation'), ('year', '@time'), ('distance', '@distance')]

p = Scatter(syn, x='year', y='distance', title="Suburbanization of Washington's Jewish Community",
            xlabel="year Jewish institution opened", ylabel="Kilometers from U.S. Capitol", tooltips=tooltips, color='blue', 
            xscale='datetime', yscale='linear', width=500, height=400)
p.y_range = Range1d(0, 25)

        
output_notebook()
output_file('syn.html')
show(p)


Loading BokehJS ...

In [28]:
from bokeh.embed import components

script, div = components(p)
print(div)


<div class="bk-root">
    <div class="plotdiv" id="0bc9381c-00a6-4c4f-b942-15fc6dd0bc4c"></div>
</div>

In [29]:
print(script)


 

In [ ]: