Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
|
@@ -88,10 +88,6 @@ def clean_data(df):
|
|
| 88 |
return df
|
| 89 |
|
| 90 |
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
|
| 95 |
# Add a extraction of JSON if CodeAgent Output is not in format
|
| 96 |
|
| 97 |
import json
|
|
@@ -195,13 +191,13 @@ def analyze_data(csv_file, additional_notes=""):
|
|
| 195 |
|
| 196 |
# Run agent on cleaned CSV
|
| 197 |
raw_output = agent.run("""
|
| 198 |
-
You are a data analysis agent. Output in JSON only. Follow these instructions EXACTLY:
|
| 199 |
1. Load the data from the given `source_file` ONLY. DO NOT create your OWN DATA.
|
| 200 |
2. Analyze the data structure and generate up to 3 visualizations and 3 insights.
|
| 201 |
3. Save all figures to `./figures` as PNG using matplotlib or seaborn.
|
| 202 |
4. Use only authorized imports: `pandas`, `numpy`, `matplotlib.pyplot`, `seaborn`, `json`.
|
| 203 |
5. DO NOT return any explanations, thoughts, or narration outside the final JSON block
|
| 204 |
-
6. Run only 5
|
| 205 |
7. DO NOT include any natural language (e.g., "Thoughts:", "Code:", explanations).
|
| 206 |
8. ONLY output a single, valid JSON block. No markdown or extra text.
|
| 207 |
9. Output ONLY the following JSON code block format, exactly:
|
|
@@ -424,10 +420,6 @@ def compare_models():
|
|
| 424 |
|
| 425 |
return results_df, plot_path
|
| 426 |
|
| 427 |
-
|
| 428 |
-
|
| 429 |
-
|
| 430 |
-
|
| 431 |
|
| 432 |
# 1. prepare_data should come first
|
| 433 |
def prepare_data(df):
|
|
|
|
| 88 |
return df
|
| 89 |
|
| 90 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 91 |
# Add a extraction of JSON if CodeAgent Output is not in format
|
| 92 |
|
| 93 |
import json
|
|
|
|
| 191 |
|
| 192 |
# Run agent on cleaned CSV
|
| 193 |
raw_output = agent.run("""
|
| 194 |
+
You are a data analysis agent. Output in JSON only. Follow these instructions EXACTLY without any deviation:
|
| 195 |
1. Load the data from the given `source_file` ONLY. DO NOT create your OWN DATA.
|
| 196 |
2. Analyze the data structure and generate up to 3 visualizations and 3 insights.
|
| 197 |
3. Save all figures to `./figures` as PNG using matplotlib or seaborn.
|
| 198 |
4. Use only authorized imports: `pandas`, `numpy`, `matplotlib.pyplot`, `seaborn`, `json`.
|
| 199 |
5. DO NOT return any explanations, thoughts, or narration outside the final JSON block
|
| 200 |
+
6. Run only 5 steps and return output in less than a minute.
|
| 201 |
7. DO NOT include any natural language (e.g., "Thoughts:", "Code:", explanations).
|
| 202 |
8. ONLY output a single, valid JSON block. No markdown or extra text.
|
| 203 |
9. Output ONLY the following JSON code block format, exactly:
|
|
|
|
| 420 |
|
| 421 |
return results_df, plot_path
|
| 422 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 423 |
|
| 424 |
# 1. prepare_data should come first
|
| 425 |
def prepare_data(df):
|