<small id='anBJf'></small><noframes id='anBJf'>

        <bdo id='anBJf'></bdo><ul id='anBJf'></ul>

    1. <i id='anBJf'><tr id='anBJf'><dt id='anBJf'><q id='anBJf'><span id='anBJf'><b id='anBJf'><form id='anBJf'><ins id='anBJf'></ins><ul id='anBJf'></ul><sub id='anBJf'></sub></form><legend id='anBJf'></legend><bdo id='anBJf'><pre id='anBJf'><center id='anBJf'></center></pre></bdo></b><th id='anBJf'></th></span></q></dt></tr></i><div id='anBJf'><tfoot id='anBJf'></tfoot><dl id='anBJf'><fieldset id='anBJf'></fieldset></dl></div>
    2. <legend id='anBJf'><style id='anBJf'><dir id='anBJf'><q id='anBJf'></q></dir></style></legend>

      <tfoot id='anBJf'></tfoot>
      1. 当 Jupyter 单元包含函数、循环或其他块时,是否可以跨单元拆分它?

        时间:2023-10-19
            <bdo id='6B5L7'></bdo><ul id='6B5L7'></ul>

              <tfoot id='6B5L7'></tfoot>
            1. <legend id='6B5L7'><style id='6B5L7'><dir id='6B5L7'><q id='6B5L7'></q></dir></style></legend>

                  <tbody id='6B5L7'></tbody>

                <small id='6B5L7'></small><noframes id='6B5L7'>

              1. <i id='6B5L7'><tr id='6B5L7'><dt id='6B5L7'><q id='6B5L7'><span id='6B5L7'><b id='6B5L7'><form id='6B5L7'><ins id='6B5L7'></ins><ul id='6B5L7'></ul><sub id='6B5L7'></sub></form><legend id='6B5L7'></legend><bdo id='6B5L7'><pre id='6B5L7'><center id='6B5L7'></center></pre></bdo></b><th id='6B5L7'></th></span></q></dt></tr></i><div id='6B5L7'><tfoot id='6B5L7'></tfoot><dl id='6B5L7'><fieldset id='6B5L7'></fieldset></dl></div>
                • 本文介绍了当 Jupyter 单元包含函数、循环或其他块时,是否可以跨单元拆分它?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  Jupyter 具有一次执行一个单元格的功能.如果一个单元格有很多语句,则通常可以(希望)将其拆分为更小的单个语句单元格,除非涉及块,例如 if、for、def 等.

                  之前有人以不同的方式提出了这个问题:

                  Jupyter has a feature in being able to execute one cell at a time. If a cell has a lot of statements it's often possible (desirable) to split it into smaller single statement cells, except when a block is involved,e.g if, for, def, etc.

                  this question was asked earlier in a different way:

                  Execute algorithm step by step in Jupyter

                  and answered

                  What is the right way to debug in iPython notebook?

                  While invoking a debugger may be the best option available, it does seem kludgy, and it likely would not work with non Python kernels.

                  What would be ideal is to have nested cells, and have a way to execute the entire block or the subcell.

                  for a Python example splitting a cell containing:

                  if 0 == 1:
                      zero = 1
                  else:
                      zero = 0
                  

                  into, say, two cells:

                  if 0 == 1:
                      zero = 1
                  

                  and

                  else:
                      zero = 0
                  

                  likewise for Julia or R.

                  a debugger solution would not be my preference.

                  解决方案

                  Unfortunately, this is not possible. The reason for this is that the else condition by itself would cause an error. You can split the cell using control+shift+subtract but once you try and run the last cell an error occurs. You can see the exact example of this in the picture I have included. Please let me know if you have any further questions/comments!

                  ]1

                  这篇关于当 Jupyter 单元包含函数、循环或其他块时,是否可以跨单元拆分它?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:阶乘函数在 Python 中工作,为 Julia 返回 0 下一篇:朱莉娅的numpy.einsum?(2)

                  相关文章

                  <tfoot id='DB0IZ'></tfoot>

                  <small id='DB0IZ'></small><noframes id='DB0IZ'>

                  <i id='DB0IZ'><tr id='DB0IZ'><dt id='DB0IZ'><q id='DB0IZ'><span id='DB0IZ'><b id='DB0IZ'><form id='DB0IZ'><ins id='DB0IZ'></ins><ul id='DB0IZ'></ul><sub id='DB0IZ'></sub></form><legend id='DB0IZ'></legend><bdo id='DB0IZ'><pre id='DB0IZ'><center id='DB0IZ'></center></pre></bdo></b><th id='DB0IZ'></th></span></q></dt></tr></i><div id='DB0IZ'><tfoot id='DB0IZ'></tfoot><dl id='DB0IZ'><fieldset id='DB0IZ'></fieldset></dl></div>

                    • <bdo id='DB0IZ'></bdo><ul id='DB0IZ'></ul>
                    <legend id='DB0IZ'><style id='DB0IZ'><dir id='DB0IZ'><q id='DB0IZ'></q></dir></style></legend>