Python Interpreter

Python is a general purpose programming language which is becoming increasingly popular among data analysts and data scientists due to the strength of its core libraries, simple data structures and growing wealth of packages and modules catering to data science, ML and AI.

Zepl provides a Python interpreter with the following popular libraries pre-installed:

Pip

Install additional libraries using pip.

Usage

%python
!pip install [packages]

Example:

%python
!pip install -q keras
import keras

The pip command installs packages in the current environment. If another environment is activated, it will install packages in the particular environment activated. Check the next section to create and switch multiple python environments.

Managing Python Environments

If you'd like to install additional environments you can use the conda interpreter bundled with the Python interpreter. Conda is open an source package and environment management system which enables easy package installation and environment switching.

Usages

Get conda information

%python.conda info

List your environments

%python.conda env list

Create an environment

%python.conda create --name [ENV_NAME]

# or if you want to specify python version (e.g 3.6)
%python.conda create --name [ENV_NAME] python=3.6

Activate an environment

%python.conda activate [ENV_NAME]

Deactivate an environment

%python.conda deactivate

List installed packages

%python.conda list

Install packages (see previous section to install packages via pip)

%python.conda install [PACKAGE1 PACKAGE2 ...]

# or if you want to specify an environment name
%python.conda install -n [ENV_NAME] [PACKAGE1 PACKAGE2 ...]

Uninstall packages

%python.conda uninstall [PACKAGE1 PACKAGE2 ...]

Help

%python.conda help

IPython Support

You can use IPython commands with the default Python interpreter in Zepl as shown below:

%python

# !ls Run a shell command.
# Install additional packages
!pip install keras

# object? Details about the object
help?

# Time execution of a Python statement or expression
%timeit range(1000)