Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -3,7 +3,8 @@
|
|
3 |
# supress warnings about future deprecations
|
4 |
# import warnings
|
5 |
# warnings.simplefilter(action='ignore', category=FutureWarning)
|
6 |
-
|
|
|
7 |
import pandas as pd
|
8 |
import altair as alt
|
9 |
# import numpy as np
|
@@ -27,8 +28,8 @@ df2=pd.melt(df2, id_vars=['president', 'subgroup', 'timestamp'], value_vars=['ap
|
|
27 |
## Viz 4
|
28 |
# Import panel and vega datasets
|
29 |
|
30 |
-
import panel as pn
|
31 |
-
import vega_datasets
|
32 |
|
33 |
# Enable Panel extensions
|
34 |
pn.extension(design='bootstrap')
|
@@ -59,7 +60,7 @@ def create_plot(subgroup, date_range, moving_av_window):
|
|
59 |
scatter4 = alt.Chart(filtered_data).mark_point(size=2, opacity=0.7, color='grey').encode(
|
60 |
x='timestamp:T',
|
61 |
y=alt.Y('rate:Q', title='approve', scale=alt.Scale(domain=[30, 60])),
|
62 |
-
)
|
63 |
|
64 |
# Put them togetehr
|
65 |
plot = (scatter4+smoothed_line).encode(
|
|
|
3 |
# supress warnings about future deprecations
|
4 |
# import warnings
|
5 |
# warnings.simplefilter(action='ignore', category=FutureWarning)
|
6 |
+
import panel as pn
|
7 |
+
import vega_datasets
|
8 |
import pandas as pd
|
9 |
import altair as alt
|
10 |
# import numpy as np
|
|
|
28 |
## Viz 4
|
29 |
# Import panel and vega datasets
|
30 |
|
31 |
+
# import panel as pn
|
32 |
+
# import vega_datasets
|
33 |
|
34 |
# Enable Panel extensions
|
35 |
pn.extension(design='bootstrap')
|
|
|
60 |
scatter4 = alt.Chart(filtered_data).mark_point(size=2, opacity=0.7, color='grey').encode(
|
61 |
x='timestamp:T',
|
62 |
y=alt.Y('rate:Q', title='approve', scale=alt.Scale(domain=[30, 60])),
|
63 |
+
)
|
64 |
|
65 |
# Put them togetehr
|
66 |
plot = (scatter4+smoothed_line).encode(
|