官术网_书友最值得收藏!

Editing and running code

A notebook contains boxes called cells. A new notebook begins with a gray box cell, which is a text area for code editing by default. To insert and edit code: 

  1. Click inside the gray box.
  2. Type in your Python code.
  3. Click on the >| play button or press Shift + Enter to run the current cell and move the cursor to the next cell:

Cells can be run in different orders and rerun multiple times in a session. The output and any warnings or error messages are shown in the output area of each cell under each gray textbox. The number in square brackets on the left shows the order of the cell last run:

Once a cell is run, stored namespaces, including functions and variables, are shared throughout the notebook before the kernel restarts.

You can edit the code of any cells while some cells are running. If for any reason you want to interrupt the running kernel, such as to stop a loop that prints out too many messages, you can do so by clicking on the square interrupt button in the toolbar.

Try not to print too much output when using Jupyter Notebook; it may crash your browser. However, long lists will be automatically abbreviated if you print them out.
主站蜘蛛池模板: 马山县| 余江县| 赤城县| 华池县| 杭锦后旗| 阿尔山市| 怀柔区| 石棉县| 商丘市| 广宁县| 新宁县| 建平县| 大理市| 亳州市| 瓮安县| 镶黄旗| 秦安县| 左云县| 宣化县| 梧州市| 东山县| 贡觉县| 塘沽区| 鄂尔多斯市| 南投市| 马山县| 灵宝市| 洪雅县| 墨竹工卡县| 昌黎县| 英山县| 金昌市| 宁陵县| 沈丘县| 贞丰县| 西贡区| 东乌| 肃北| 香港 | 连南| 泰顺县|