如何在 Databricks 上运行单行代码单元格?

huangapple go评论62阅读模式
英文:

How do I run single line of code in a cell on Databricks?

问题

在Databricks笔记本中,我想要在单元格中只运行一行代码。例如,这是我的单元格:

print("line 1")
print("line 2")

我想要执行的只是 print("line 1")。我知道如何在Jupyter Notebook 中实现这一点,但不知道如何在Databricks笔记本中实现。

英文:

In Databricks notebook I would like to run only single line of code in a cell. For example here is my cell

print("line 1")
print("line 2")

and I would like to execute only print("line 1"). I found how to do it in Jupyter Notebook, but not in Databricks notebook.

答案1

得分: 1

不是确切的答案,但可能对其他人有用;如此处所述,您可以通过选择该行然后按下Shift + Control + Enter来运行单元格的一部分。

英文:

Not the exact answer but might be useful for others; as mentioned here you can run only part of the cell by selecting the line and pressing Shift + Control + Enter.

huangapple
  • 本文由 发表于 2023年6月2日 03:19:42
  • 转载请务必保留本文链接:https://go.coder-hub.com/76385053.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定