Add seaborn integration to fix 'sns is not defined' errors
Browse filesSEABORN INTEGRATION:
- Add 'import seaborn as sns' to code template in src.py
- Add 'sns': __import__('seaborn') to execution globals
- Ensures seaborn is available in all generated code without import errors
FIXES:
- "name 'sns' is not defined" errors in correlation analysis
- Missing seaborn imports in heatmaps and statistical plots
- Enables sns.barplot(), sns.heatmap(), sns.scatterplot() usage
Now all seaborn visualization functions work seamlessly with the awesome matplotlib styling.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <[email protected]>
src.py
CHANGED
@@ -145,6 +145,7 @@ def ask_question(model_name, question):
|
|
145 |
local_vars = {}
|
146 |
global_vars = {
|
147 |
'pd': pd, 'plt': plt, 'os': os,
|
|
|
148 |
'uuid': __import__('uuid'),
|
149 |
'calendar': __import__('calendar'),
|
150 |
'np': __import__('numpy'),
|
@@ -248,6 +249,7 @@ def ask_question(model_name, question):
|
|
248 |
template = f"""```python
|
249 |
import pandas as pd
|
250 |
import matplotlib.pyplot as plt
|
|
|
251 |
import uuid
|
252 |
import calendar
|
253 |
import numpy as np
|
|
|
145 |
local_vars = {}
|
146 |
global_vars = {
|
147 |
'pd': pd, 'plt': plt, 'os': os,
|
148 |
+
'sns': __import__('seaborn'),
|
149 |
'uuid': __import__('uuid'),
|
150 |
'calendar': __import__('calendar'),
|
151 |
'np': __import__('numpy'),
|
|
|
249 |
template = f"""```python
|
250 |
import pandas as pd
|
251 |
import matplotlib.pyplot as plt
|
252 |
+
import seaborn as sns
|
253 |
import uuid
|
254 |
import calendar
|
255 |
import numpy as np
|