Documentation IndexFetch the complete documentation index at: /llms.txtUse this file to discover all available pages before exploring further.
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Run Python code interpreter cells with persistent state and rich outputs.
code-interpreter
result = sandbox.run_code(""" import numpy as np values = np.array([1, 2, 3]) values.mean() """, language="python") print(result.results[0].text)
ctx = sandbox.code_interpreter.create_code_context(language="python") sandbox.code_interpreter.run_code("import pandas as pd", context=ctx) sandbox.code_interpreter.run_code("df = pd.DataFrame({'x': [1, 2, 3]})", context=ctx) result = sandbox.code_interpreter.run_code("df['x'].sum()", context=ctx)
install_packages()