adollbo commited on
Commit
01b886b
·
1 Parent(s): 3f57652

changed to static table size due to streamlit jittering bug

Browse files
Files changed (1) hide show
  1. utils.py +3 -3
utils.py CHANGED
@@ -161,13 +161,13 @@ def create_data_input_table(data, col_names):
161
  data[7:12] = [bool(value) for value in data[7:12]]
162
  rounded_list = [round(value, 2) if isinstance(value, float) else value for value in data]
163
  df = pd.DataFrame({"Feature name": col_names, "Value": rounded_list })
164
- st.dataframe(df, hide_index=True, use_container_width=True, height=35*len(df)+38) #width=450
165
 
166
  # Create a function to generate a table
167
  def create_table(texts, values, weights, title):
168
  df = pd.DataFrame({"Feature Explanation": texts, 'Value': values, 'Weight': weights})
169
  st.markdown(f'#### {title}') # Markdown for styling
170
- st.dataframe(df, hide_index=True, use_container_width=True, column_config={
171
  'Weight': st.column_config.ProgressColumn(
172
  'Weight',
173
  width='small',
@@ -175,7 +175,7 @@ def create_table(texts, values, weights, title):
175
  min_value=0,
176
  max_value=1
177
  )
178
- }) #width=450 # Display a simple table
179
 
180
 
181
  def ChangeButtonColour(widget_label, font_color, background_color='transparent'):
 
161
  data[7:12] = [bool(value) for value in data[7:12]]
162
  rounded_list = [round(value, 2) if isinstance(value, float) else value for value in data]
163
  df = pd.DataFrame({"Feature name": col_names, "Value": rounded_list })
164
+ st.dataframe(df, hide_index=True, width=450, height=35*len(df)+38) # use_container_width=True
165
 
166
  # Create a function to generate a table
167
  def create_table(texts, values, weights, title):
168
  df = pd.DataFrame({"Feature Explanation": texts, 'Value': values, 'Weight': weights})
169
  st.markdown(f'#### {title}') # Markdown for styling
170
+ st.dataframe(df, hide_index=True, width=450, column_config={
171
  'Weight': st.column_config.ProgressColumn(
172
  'Weight',
173
  width='small',
 
175
  min_value=0,
176
  max_value=1
177
  )
178
+ }) #use_container_width=True
179
 
180
 
181
  def ChangeButtonColour(widget_label, font_color, background_color='transparent'):