1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Anuncie Aqui
    Anuncie aqui você Também: fdantas@4each.com.br

[Python] Databricks multiple output from a cell

Discussão em 'Python' iniciado por Stack, Setembro 10, 2025.

  1. Stack

    Stack Membro Participativo

    Normally I run this code at the top of notebooks to allow printout of multiple outputs from a cell (without having to use print statements.

    from IPython.core.interactiveshell import InteractiveShell
    InteractiveShell.ast_node_interactivity = "all"


    But this does not seem to work with databricks notebooks. In databricks, that setting would print out multiple outputs but on the same line, without spacing.

    What is the equivalent command in DBX to get multiple outputs in a cell?

    Example:

    At the top of the notebook run:

    from IPython.core.interactiveshell import InteractiveShell
    InteractiveShell.ast_node_interactivity = "all"


    Then in a cell do:

    math.pi
    math.cos(2*math.pi)


    Expected cell output:

    3.141592653589793
    1.0


    But get:

    3.1415926535897931.0

    Continue reading...

Compartilhe esta Página