Spaces:
Runtime error
Runtime error
Update main.py
Browse files
main.py
CHANGED
|
@@ -44,21 +44,16 @@ def execute_python(code: str) -> str:
|
|
| 44 |
"""Execute Python code in an IPython interactiveshell and return the output.
|
| 45 |
The returned artifacts (if present) are automatically rendered in the UI and visible to the user.
|
| 46 |
Args:
|
| 47 |
-
code:
|
|
|
|
| 48 |
Available Libraries:
|
| 49 |
-
# Use
|
| 50 |
-
|
| 51 |
-
# Remove the ticker level from columns if it exists
|
| 52 |
-
yf_data = yf.download(symbol, start=start_date, end=end_date)
|
| 53 |
-
if isinstance(yf_data.columns, pd.MultiIndex):
|
| 54 |
-
yf_data.columns = yf_data.columns.get_level_values(0)
|
| 55 |
-
matplotlib
|
| 56 |
-
pandas
|
| 57 |
plotly
|
|
|
|
| 58 |
groq
|
| 59 |
yfinance
|
| 60 |
numpy
|
| 61 |
-
seaborn
|
| 62 |
numpy
|
| 63 |
scikit-learn
|
| 64 |
statsmodels
|
|
|
|
| 44 |
"""Execute Python code in an IPython interactiveshell and return the output.
|
| 45 |
The returned artifacts (if present) are automatically rendered in the UI and visible to the user.
|
| 46 |
Args:
|
| 47 |
+
code: Valid Python code with correct indentation and syntax including necessary imports.
|
| 48 |
+
|
| 49 |
Available Libraries:
|
| 50 |
+
# Use Plotly for creating visualizations
|
| 51 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 52 |
plotly
|
| 53 |
+
pandas
|
| 54 |
groq
|
| 55 |
yfinance
|
| 56 |
numpy
|
|
|
|
| 57 |
numpy
|
| 58 |
scikit-learn
|
| 59 |
statsmodels
|