DEV Community

Cover image for How to use IPython in Apache Zeppelin Notebook
Jeff Zhang
Jeff Zhang

Posted on • Updated on

How to use IPython in Apache Zeppelin Notebook

Apache Zeppelin Notebook is web-based notebook that enables data-driven, interactive data analytics and collaborative documents with SQL, Scala, Python and more.

In this post, I will talk about how to use IPython in Apache Zeppelin Notebook (Although Zeppelin support vanilla Python, it is strongly recommended to use IPython). This would make the Python development experience in Zeppelin notebook almost the same as Jupyter notebook.

All the contents in this notebook can be found in these 2 example notebook.

How to configure

Enable IPython in Zeppelin is pretty straightforward, first you need to install the following 3 python packages

pip install jupyter
pip install grpcio
pip install protobuf
Enter fullscreen mode Exit fullscreen mode

Besides manually installing these packages, you can also use conda to create a customized python environment which has these installed. You can check this post for more details.

Then configure Python Interpreter,the most important configuration is zeppelin.python which need to point to the correct python executable in case you have multiple python installed in your machine.

IPython Config

IPython Features

Now, you can experience almost the same python development experience as Jupyter notebook. Here’s a list of feature that I’d like to highlight.

  • Support ipython magic function
  • Better code completion
  • Rich visualization libraries support

IPython magic function

Magic function

Code completion

Code completion

Rich visualization libraries support

Visualization libraries are a big family of python ecosystem. Like jupyter notebook, you can use most of the popular python visualization libraries in Zeppelin notebook.

Here’re a list of examples of how to use popular python visualization libraries in Zeppelin:

  • Matplotlib
  • Pandas
  • Seaborn
  • Plotnine
  • Bokeh
  • Holoviews
  • Altair

Matplotlib

Pandas

Seaborn

Plotnine

Bokeh

Holoviews

Altair

Summary

This is just a brief introduction of how to use IPython in Zeppelin notebook. If you have any question, you can ask in zeppelin user mail list or slack channel (http://zeppelin.apache.org/community.html)

References

Discussion (0)