Skip to content

Commit

Permalink
minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
linozen committed Jul 14, 2021
1 parent 92c6b54 commit b19d775
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions explorer/all.py
Original file line number Diff line number Diff line change
Expand Up @@ -640,7 +640,7 @@ def get_merged_ms_df():
}
)
###################################################################################
# Make answers analysable
# Make answers analysable (change data types etc.)
###################################################################################
df["hr2"] = df["hr2"].replace("?", np.nan)
df["hr2"] = df["hr2"].replace("0,5", 0.5)
Expand All @@ -660,7 +660,7 @@ def get_merged_ms_df():
###################################################################################
# Filter logic
###################################################################################
# TODO filter by attitudes
# TODO filter by attitudes1-2
filters = {
"surveytype": st.sidebar.selectbox(
"Survey type", ["All", "Civil Society Scrutiny", "Media Scrutiny"]
Expand Down Expand Up @@ -711,7 +711,7 @@ def get_csv_download_link(df):
b64 = base64.b64encode(
csv.encode()
).decode() # some strings <-> bytes conversions necessary here
href = f'<a href="data:file/csv;base64,{b64}">Download as CSV file</a>'
href = f'<a href="data:file/csv;base64,{b64}" download="ioi_all.csv">Download as CSV file</a>'
return href


Expand All @@ -731,7 +731,7 @@ def get_excel_download_link(df):
"""
val = to_excel(df)
b64 = base64.b64encode(val)
return f'<a href="data:application/octet-stream;base64,{b64.decode()}" download="ioi.xlsx">Download as Excel file</a>'
return f'<a href="data:application/octet-stream;base64,{b64.decode()}" download="ioi_all.xlsx">Download as Excel file</a>'


st.write(get_csv_download_link(df), unsafe_allow_html=True)
Expand Down Expand Up @@ -918,8 +918,6 @@ def get_excel_download_link(df):
)
st.plotly_chart(foi5_fig)

# st.plotly_chart(foi5_fig)

# Stacked Bar Chart (msprotectops1)
st.write(
"Have you taken any of the following measures to protect your datas from attacks and surveillance? `[protectops1]`"
Expand Down

0 comments on commit b19d775

Please sign in to comment.