Repository: zeppelin Updated Branches: refs/heads/branch-0.6 ace14afa3 -> aedce7377
[ZEPPELIN-1206] fix "name 'z' is not defined" with python3 PythonInterpreter can not use dynamic form with python3. Fix this problem. Bug Fix * https://issues.apache.org/jira/browse/ZEPPELIN-1206 ``` %python print(z.input("test")) ``` Make a note above, and run it. * Does the licenses files need update? NO * Is there breaking changes for older versions? NO * Does this needs documentation? NO Author: Sangmin Yoon <[email protected]> Closes #1213 from sixmen/fix_python3 and squashes the following commits: be6f68b [Sangmin Yoon] fix "name 'z' is not defined" with python3 (cherry picked from commit 80d910049b8678b740bc4beff4757a5de5410053) Signed-off-by: Lee moon soo <[email protected]> Project: http://git-wip-us.apache.org/repos/asf/zeppelin/repo Commit: http://git-wip-us.apache.org/repos/asf/zeppelin/commit/aedce737 Tree: http://git-wip-us.apache.org/repos/asf/zeppelin/tree/aedce737 Diff: http://git-wip-us.apache.org/repos/asf/zeppelin/diff/aedce737 Branch: refs/heads/branch-0.6 Commit: aedce7377e1d067b5995660b8261b3450016e5ae Parents: ace14af Author: Sangmin Yoon <[email protected]> Authored: Thu Jul 21 17:08:44 2016 +0900 Committer: Lee moon soo <[email protected]> Committed: Wed Jul 27 08:00:57 2016 +0900 ---------------------------------------------------------------------- python/src/main/resources/bootstrap.py | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/zeppelin/blob/aedce737/python/src/main/resources/bootstrap.py ---------------------------------------------------------------------- diff --git a/python/src/main/resources/bootstrap.py b/python/src/main/resources/bootstrap.py index c37e25f..e225f03 100644 --- a/python/src/main/resources/bootstrap.py +++ b/python/src/main/resources/bootstrap.py @@ -72,7 +72,9 @@ plt.close() print ('''<pre>z.show(plt,width='50px') z.show(plt,height='150px') </pre></div>''') print ('<h3>Pandas DataFrame</h3>') - print """ + print ('<div> You need to have Pandas module installed ') + print ('to use this functionality (pip install pandas) !</div><br/>') + print (""" <div>The interpreter can visualize Pandas DataFrame with the function z.show() <pre> @@ -80,7 +82,27 @@ import pandas as pd df = pd.read_csv("bank.csv", sep=";") z.show(df) </pre></div> -""" +""") + print ('<h3>SQL over Pandas DataFrame</h3>') + print ('<div> You need to have Pandas&Pandasql modules installed ') + print ('to use this functionality (pip install pandas pandasql) !</div><br/>') + print (""" +<div>Python interpreter group includes %sql interpreter that can query +Pandas DataFrames using SQL and visualize results using Zeppelin Table Display System + +<pre> +%python +import pandas as pd +df = pd.read_csv("bank.csv", sep=";") +</pre> +<br /> + +<pre> +%python.sql +%sql +SELECT * from df LIMIT 5 +</pre></div> +""") class PyZeppelinContext(object): """ If py4j is detected, these class will be override
