Use a code cell to write, run and inspect code and add it to your notebook.
- 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.
To run code:
- Use "Run" in the cell menu or
Enterto run the currently active code cell.
Enterto run the currently active code cell and make the next cell in the notebook active.
There is a 'stoplight' dot on the top-right hand side of your workspace 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.
- 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.
If you're in a Python workspace, you can only write Python code; if you're in an R workspace, you can write only Python code. If you want to work with the other language, you have to create a new workspace in that language.