Skip to content

Commit

Permalink
minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
linozen committed Aug 24, 2021
1 parent 645953a commit c42ad77
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions explorer/merged.py
Original file line number Diff line number Diff line change
Expand Up @@ -987,13 +987,16 @@ def get_merged_ms_df():
"### Respondents working more than 5 days on surveillance by intelligence agencies? `[hr2]`"
)
df["hr2_more_than_five"] = np.where(df["hr2"] > 5, True, False)
df["hr2_more_than_five"] = pd.to_numeric(df["hr2_more_than_five"], errors="coerce")
df["hr2_more_than_five"] = df["hr2_more_than_five"].replace(
{True: ">5 days", False: "5 days or less"}
)
hr2_more_than_five_counts = df[filter]["hr2_more_than_five"].value_counts()
print(hr2_more_than_five_counts)
st.plotly_chart(
render_pie_chart(
hr2_more_than_five_counts,
values=hr2_more_than_five_counts,
names=["<5 days", ">5 days"],
names=hr2_more_than_five_counts.index,
color=hr2_more_than_five_counts.index,
)
)
Expand Down Expand Up @@ -1481,7 +1484,7 @@ def get_merged_ms_df():
)
)

st.write("### If you selected ‘other’, please specify `[protectleg2no]`")
st.write("### If you selected ‘no’, please specify `[protectleg2no]`")
for i in df[filter]["protectleg2no"].to_list():
if type(i) != float:
st.write("- " + i)
Expand Down

0 comments on commit c42ad77

Please sign in to comment.