Using a Code Cell
Write & Run Code in a Notebook.
Last updated
Write & Run Code in a Notebook.
Last updated
You can write and execute code using the Notebook interface. This section covers the steps to write and run a sample code in the Code cell of the Data Science Notebook.
Check out the given walk-through on how to use a Code Cell under a .ipynb file.
Create a new Notebook and open it.
A cell to write and execute code opens under the selected .ipynb file by default.
Load a dataset into the given .ipynb file.
Click the Run cell icon to run the code.
The Run cell button gets changed into the Interrupt cell icon while running the code.
Once the code has run successfully a checkmark appears below the Run cell icon.
Add new code cell gets added, insert the Show function in that cell.
Run the code cell.
The dataset preview appears below.
Another code cell gets added below (as shown in the following image).
Click the Save icon provided for the Notebook.
A notification message appears to indicate the completion of the action.
The Notebook status gets changed as saved and the new updates get saved in it.
By clicking on an inserted Code cell, some code related options get displayed as shown in the below-given image:
1
Move the cell up
Moves the cell upwards
2
Move the cell down
Moves the cell downwards
3
Delete Cell
Deletes the code cell.