DataLab Docs
  • What is DataLab?
  • Work
    • Creating a workbook
    • Sharing a workbook
    • Managing a workbook
    • Code cell
      • Working with packages
    • Text cell
      • Including images
    • SQL cell
      • SQL scenarios
      • Parameterize your SQL query
    • Explore Data cell
    • Chart cell
      • Configuring your chart
      • Pivot charts
      • Migration guide
    • AI Assistant
    • Version history
    • Scheduled runs
    • Hiding and showing cells
    • Long-running cells
    • Report view
    • Environment variables
    • Git and GitHub
  • Connect to Data
    • Connect your data to DataLab
    • Sharing a Data Source
    • Airtable
    • Amazon Athena
    • Amazon S3
    • Databricks
    • Dropbox
    • Files
    • Google Drive
    • Google BigQuery
    • Google Sheets
    • MariaDB
    • Microsoft SQL Server
    • MongoDB
    • MotherDuck
    • MySQL
    • Oracle Database
    • PostgreSQL
    • Redshift
    • Snowflake
    • Supabase
  • Guides
    • Publish a notebook
    • Importing data from flat files
    • Resizing plots
    • Show Bokeh and Pyvis plots
  • Resources
    • Pricing
    • Manage group settings
    • Reporting for Group Admins
    • DataLab for education
    • Technical requirements
    • Addressing slow code
    • Address R vulnerability
    • Get help
Powered by GitBook
On this page
  • Writing code
  • Running code
  • Inspect results
  • Workbook language = code cell language

Was this helpful?

  1. Work

Code cell

PreviousManaging a workbookNextWorking with packages

Last updated 1 year ago

Was this helpful?

Use a code cell to write, run and inspect code and add it to your notebook.

Writing code

  • Write code like you would do in any other coding environment!

  • You will get code suggestions while you type, so you don't have to type long function or variables names in full.

Running code

To run code:

  • Use "Run" in the cell menu or Ctrl + Enter to run the currently active code cell.

  • Use Shift + Enter to run the currently active code cell and make the next cell in the notebook active.

Code cell status

There is a 'stoplight' dot on the top-right hand side of your workbook with different states:

The cell successfully ran, and the code in the cell hasn't changed since.

The cell successfully ran before, but since then the code has changed, so the cell output may be stale.

The code cell is in the process of (re)running

The cell failed to execute successfully because of an error.

Inspect results

  • If your code prints out text, data frames or charts, these will appear below the code cell.

  • If your code generates several printouts, these will appear below the code cell one after the other.

Workbook language = code cell language

If you're in a Python workbook, you can only write Python code; if you're in an R workbook, you can write only Python code. If you want to work with the other language, you have to create a new workbook in that language.