Skip to main content

Python

Bindings: %python, %python.ipython, %python.sql, %python.conda, %python.docker

Runs Python code. %python is the general-purpose binding; the others cover more specific workflows:

BindingUse it for
%pythonRegular Python scripts
%python.ipythonAn interactive IPython shell (better completion and magics)
%python.sqlRunning SQL directly over pandas DataFrames
%python.condaRunning Python inside a named Conda environment
%python.dockerRunning Python inside an isolated Docker container
%python
import pandas as pd
df = pd.read_csv("/data/sales.csv")
ssnc.show(df.head(20))

Configuration

PropertyDefaultDescription
skeyenote.pythonpythonPath to the Python binary executable to use.
skeyenote.python.maxResult1000Max number of DataFrame rows to display in a result.
skeyenote.python.useIPythontrueWhether %python transparently uses IPython when it's available.

These are set by your administrator from the interpreter settings screen — for example to point %python at a specific virtual environment.