Skip to content

Commit

Permalink
Merge pull request #35 from jvivian/jvivian/issue26
Browse files Browse the repository at this point in the history
Add option to invert factor on factor analysis page
  • Loading branch information
jvivian authored Feb 21, 2024
2 parents e8a6de4 + 4cb2098 commit 677c987
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion coverage.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" ?>
<coverage version="7.3.1" timestamp="1708495065791" lines-valid="147" lines-covered="145" line-rate="0.9864" branches-valid="54" branches-covered="51" branch-rate="0.9444" complexity="0">
<coverage version="7.3.1" timestamp="1708496031059" lines-valid="147" lines-covered="145" line-rate="0.9864" branches-valid="54" branches-covered="51" branch-rate="0.9444" complexity="0">
<!-- Generated by coverage.py: https://coverage.readthedocs.io/en/7.3.1 -->
<!-- Based on https://raw.githubusercontent.com/cobertura/web/master/htdocs/xml/coverage-04.dtd -->
<sources>
Expand Down
2 changes: 2 additions & 0 deletions covid19_drdfm/streamlit/pages/1_Factor_Analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@
new = normalize(raw.query("State == @state")[columns].iloc[1:]) # .reset_index(drop=True)

# Normalize factors and add to new dataframe
if st.sidebar.checkbox("Invert Factor"):
df[factor] = df[factor] * -1
df = normalize(df[df.State == state]).reset_index(drop=True)
new[factor] = list(df[factor])

Expand Down

0 comments on commit 677c987

Please sign in to comment.