CosmickVisions commited on
Commit
2d63634
·
verified ·
1 Parent(s): ad2eb38

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -13
app.py CHANGED
@@ -144,18 +144,7 @@ st.markdown("""
144
  padding: 5px;
145
  }
146
  }
147
- footer {
148
- text-align: center;
149
- padding: 10px;
150
- background-color: var(--blue);
151
- color: white;
152
- border-radius: 5px;
153
- margin-top: 20px;
154
- }
155
  </style>
156
- <footer>
157
- <p>Created by Calvin Allen-Crawford</p>
158
- </footer>
159
  """, unsafe_allow_html=True)
160
 
161
  # Session State Initialization
@@ -195,12 +184,16 @@ PREBUILT_MODELS = {
195
  }
196
  }
197
 
198
- # Helper Functions (unchanged)
199
  def convert_df_to_text(df):
200
  text = f"Dataset Summary: {df.shape[0]} rows, {df.shape[1]} columns\n"
201
  text += f"Missing Values: {df.isna().sum().sum()}\n"
202
  for col in df.columns:
203
- text += f"- {col} ({df[col].dtype}): Mean={df[col].mean():.2f if pd.api.types.is_numeric_dtype(df[col]) else 'N/A'}\n"
 
 
 
 
204
  return text
205
 
206
  def create_vector_store(df_text):
 
144
  padding: 5px;
145
  }
146
  }
 
 
 
 
 
 
 
 
147
  </style>
 
 
 
148
  """, unsafe_allow_html=True)
149
 
150
  # Session State Initialization
 
184
  }
185
  }
186
 
187
+ # Helper Functions
188
  def convert_df_to_text(df):
189
  text = f"Dataset Summary: {df.shape[0]} rows, {df.shape[1]} columns\n"
190
  text += f"Missing Values: {df.isna().sum().sum()}\n"
191
  for col in df.columns:
192
+ if pd.api.types.is_numeric_dtype(df[col]):
193
+ mean_value = f"{df[col].mean():.2f}"
194
+ else:
195
+ mean_value = "N/A"
196
+ text += f"- {col} ({df[col].dtype}): Mean={mean_value}\n"
197
  return text
198
 
199
  def create_vector_store(df_text):