Cachoups commited on
Commit
a9d6164
·
verified ·
1 Parent(s): 7d5fe38

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -0
app.py CHANGED
@@ -207,12 +207,15 @@ def generate_text(df, country, theme):
207
  # Create a formatted string with colons and percentages
208
  formatted_row = []
209
  for col, value in row.items():
 
210
  if col != 'Country': # Exclude 'Country' or format differently if needed
211
  if isinstance(value, (int, float)): # Add percentage sign for numeric values
212
  value_str = f"{value:.6f}%"
213
  else:
214
  value_str = str(value)
215
  formatted_row.append(f"{col}: {value_str}")
 
 
216
  return "\n".join(formatted_row)
217
  # Convert the row to a string format for prompt
218
  row = df[df['Country'] == country].iloc[0]
 
207
  # Create a formatted string with colons and percentages
208
  formatted_row = []
209
  for col, value in row.items():
210
+ print(col)
211
  if col != 'Country': # Exclude 'Country' or format differently if needed
212
  if isinstance(value, (int, float)): # Add percentage sign for numeric values
213
  value_str = f"{value:.6f}%"
214
  else:
215
  value_str = str(value)
216
  formatted_row.append(f"{col}: {value_str}")
217
+ else:
218
+ formatted_row.append(f"{col}: {value}")
219
  return "\n".join(formatted_row)
220
  # Convert the row to a string format for prompt
221
  row = df[df['Country'] == country].iloc[0]