Skip to content

Commit

Permalink
fix component
Browse files Browse the repository at this point in the history
  • Loading branch information
dayesouza committed Apr 17, 2024
1 parent 0d60db2 commit 7eca347
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/util/ui_components.py
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,6 @@ def prepare_input_df(workflow, input_df_var, processed_df_var, output_df_var, id
st.session_state[f'{workflow}_{val}'] = False
processed_df_var.value[val] = values.apply(lambda x: 1 if val in x and val != 'nan' else None)
# processed_df_var.value[col][col+'_'+val] = values.apply(lambda x: 1 if val in x and val != 'nan' else None)
st.session_state[f'{workflow}_binned_df'] = processed_df_var.value.copy(deep=True)
processed_df_var.value.drop(columns=[col], inplace=True)

if selected_cols != st.session_state[f'{workflow}_last_attributes']:
Expand Down Expand Up @@ -424,6 +423,8 @@ def convert(x):
bdf = st.session_state[f'{workflow}_binned_df']
for col in processed_df_var.value.columns:
if col != 'Subject ID':
if col not in bdf:
continue
value_counts = bdf[col].value_counts()
# convert to dict with value as key and count as value
value_counts = dict(zip(value_counts.index, value_counts.values))
Expand Down

0 comments on commit 7eca347

Please sign in to comment.