How To: Pass values between Scala and Python interpreters in Notebook

Description:

This article tells how to pass variable values between Scala and Python interpreters in Notebooks.

How To:

You can pass variable from between spark and pyspark in this way.

    %spark
    z.put("var1", myVar)

    %pyspark
    myVar = z.get("var1")

Similarly, you can pass variables values from pyspark to spark.

Have more questions? Submit a request

Comments

  • Avatar
    Naman Mehta

    I have a very minor question, if anyone can tell me, what is "z" in the above lines ??

Powered by Zendesk