Spaces:
Runtime error
Runtime error
matplotlib close
Browse files
app.py
CHANGED
@@ -47,6 +47,8 @@ def is_duplicate(s):
|
|
47 |
if "duplicates" in st.session_state:
|
48 |
check_candidate = (s["Id"], s["Time"])
|
49 |
res = check_candidate in st.session_state["duplicates"]
|
|
|
|
|
50 |
st.session_state["duplicates"].add(check_candidate)
|
51 |
return res
|
52 |
|
@@ -106,18 +108,19 @@ with col2:
|
|
106 |
# chart_data.set_index('date')
|
107 |
|
108 |
with placeholder.container():
|
|
|
|
|
|
|
109 |
try:
|
110 |
-
fig, ax = plt.subplots()
|
111 |
-
plt.rcParams["figure.figsize"] = (20, 8)
|
112 |
if graph_type == 'Line':
|
113 |
ax.plot(range(len(chart_data[0])), chart_data[0])
|
114 |
elif graph_type == 'Bar':
|
115 |
ax.bar(range(len(chart_data[0])), chart_data[0])
|
116 |
plt.xticks(range(len(chart_data[0])), chart_data[1])
|
117 |
# st.bar_chart(chart_data)
|
118 |
-
st.pyplot(fig)
|
119 |
except Exception as e:
|
120 |
pass
|
|
|
121 |
# st.map(df)
|
122 |
st.write(df)
|
123 |
# time.sleep(15)
|
|
|
47 |
if "duplicates" in st.session_state:
|
48 |
check_candidate = (s["Id"], s["Time"])
|
49 |
res = check_candidate in st.session_state["duplicates"]
|
50 |
+
else:
|
51 |
+
st.session_state["duplicates"] = set()
|
52 |
st.session_state["duplicates"].add(check_candidate)
|
53 |
return res
|
54 |
|
|
|
108 |
# chart_data.set_index('date')
|
109 |
|
110 |
with placeholder.container():
|
111 |
+
plt.rcParams["figure.figsize"] = (20, 8)
|
112 |
+
plt.close()
|
113 |
+
fig, ax = plt.subplots()
|
114 |
try:
|
|
|
|
|
115 |
if graph_type == 'Line':
|
116 |
ax.plot(range(len(chart_data[0])), chart_data[0])
|
117 |
elif graph_type == 'Bar':
|
118 |
ax.bar(range(len(chart_data[0])), chart_data[0])
|
119 |
plt.xticks(range(len(chart_data[0])), chart_data[1])
|
120 |
# st.bar_chart(chart_data)
|
|
|
121 |
except Exception as e:
|
122 |
pass
|
123 |
+
st.pyplot(fig)
|
124 |
# st.map(df)
|
125 |
st.write(df)
|
126 |
# time.sleep(15)
|