Yandex.Cloud
  • Services
  • Why Yandex.Cloud
  • Solutions
  • Pricing
  • Documentation
  • Contact us
Get started
Yandex DataSphere
  • Getting started
  • Step-by-step instructions
    • All instructions
    • Creating a project
    • Installing dependencies
    • Running sample code in a notebook
    • Versioning. Working with checkpoints
    • Managing computing resources
    • Clearing the interpreter state
    • Sharing a notebook
      • Publishing a notebook
      • Exporting a project
    • Changing a name or description
    • Deleting a project
    • Working with Git
    • Setting up integration with Data Proc
  • Concepts
    • Overview
    • Project
    • List of pre-installed software
    • Available commands
    • Computing resource configurations
    • Integration with version and data control systems
    • Integration with Data Proc
    • Using TensorBoard in DataSphere
    • Background operations
    • Quotas and limits
  • Use cases
    • Voice recognition
  • Access management
  • Pricing policy
  • Questions and answers
  1. Concepts
  2. Available commands

Available commands

  • Disabled standard commands
    • Alternative use of blocked commands
  • Additional commands
    • Managing state saving
    • Adding read-only variables

The list of commands available in the notebook is made up of standard commands with some restrictions and additions. View the list of standard commands in the IPython documentation. Restrictions and additions are given below.

Disabled standard commands

Standard commands that aren't available in the notebook:

  • %%bash
  • %%perl
  • %%python
  • %%python2
  • %%python3
  • %%ruby
  • %%script
  • %%sh

Alternative use of blocked commands

%%bash

To run bash commands, put 'bash' explicitly at the beginning of the cell:

  • With no configuration specified. The default configuration is used in this case.

    #!:bash
    
  • With a configuration specified:

    #!<configuration name>:bash
    

    For example, to run commands in the configuration c1.4 , enter #!c1.4 :bash.

The available configurations are described in Computing resource configurations

Limits

The following restrictions apply to using bash commands:

  • Background jobs are not supported, for example, sshd.
  • Launching pip is not supported. Use the %pip format for pip.

Additional commands

Additional commands available in the notebook.

Managing state saving

Commands to exclude and add variables when saving a state:

  • %%state_exclude [variable names]: Excludes the specified variables when saving a state.
  • %%state_include [variable names]: Adds the specified variables when saving a state.
  • %%state_include_all: Returns all variables when saving a state.
  • %%state_exclude_ls: Returns a list of all variables that were excluded when saving a state.

Adding read-only variables

The state of cells is saved after they're run and the variable values are overwritten. Saving large variables may take some time. If a variable is intended to store a constant value, it can be declared as a read-only variable. Such variables aren't overwritten when saving and serializing data, which speeds up these operations.

To specify that a cell's variable is read-only, use the command:

#pragma readonly/ro <variable 1>, <variable 2>

This command should be placed in the first lines of the cell before the code but allowed after the configuration update (#!c1.4 , #!g1.1).

Possible options for writing the command using x and y variables as an example:

  • #pragma readonly x, y
  • #pragma readonly x y
  • #pragma readonly x
  • #pragma readonly y
  • #pragma ro x, y

See also

  • Installing dependencies
  • Computing resource configurations
  • Quotas and limits
  • All instructions
In this article:
  • Disabled standard commands
  • Alternative use of blocked commands
  • Additional commands
  • Managing state saving
  • Adding read-only variables
Language / Region
Careers
Privacy policy
Terms of use
Brandbook
© 2021 Yandex.Cloud LLC