在Apache Zeppelin上运行独立的python脚本

我一直在使用Apache Zeppelin Notebook来运行Scala代码。现在,需要在同一笔记本上运行独立的Python脚本。 Scala代码在前面的段落中生成一些CSV文件,这些文件应作为参数传递给Python脚本。从同一Zeppelin笔记本的另一段中运行Python脚本的简便方法是什么?

tasa86 回答:在Apache Zeppelin上运行独立的python脚本

Zeppelin提供了几种口译员,可以将其绑定到相应的笔记本上。单击笔记本右上方的“解释器绑定”选项,以查看笔记本支持的功能。

enter image description here

由于它支持Shell解释器%sh,因此我仅使用它来运行带有参数的独立python脚本。

%sh
python evaluate.py gold.csv pred.csv 

如果不确定输入文件和脚本的位置,则可以在Zeppelin段落中运行Shell命令pwd来查找它们。

%sh
pwd
本文链接:https://www.f2er.com/3133998.html

大家都在问