J'utilise le noyau PySpark
installé par Apache Toree
en Jupyter Notebook
en utilisant Anaconda v4.0.0
(Python 2.7.11
). Après avoir obtenu une table de Hive
, utilisez matplotlib/panda
pour tracer un graphe dans le cahier Jupyter, suivant le tutoriel ci-dessous:Comment faire pour obtenir ipython inbuild commande magique pour travailler dans le cahier Jupyter Pyspark kernel?
%matplotlib inline
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
# Set some Pandas options
pd.set_option('display.notebook_repr_html', False)
pd.set_option('display.max_columns', 20)
pd.set_option('display.max_rows', 25)
normals = pd.Series(np.random.normal(size=10))
normals.plot()
J'étais coincé au premier lien lorsque j'ai essayé d'utiliser% en ligne de matplotlib qui montre
Name: Error parsing magics!
Message: Magics [matplotlib] do not exist!
StackTrace:
regardant Toree Magic et MagicManager, je réalise que %matplotlib
appelle MagicManager
au lieu du iPython
en construire commande magique.
Est-il possible pour Apache Toree - PySpark
d'utiliser la commande magique iPython in-build à la place?
Installer 'matplotlib'? – zero323
@ zero323 Je peux importer 'matplotlib' mais quand j'essaie d'exécuter'% matplotlib inline' sur la console de l'ordinateur portable Jupyter affiche '16/09/20 09:40:24 ERROR magic.MagicManager: Pas de magie trouvée pour matplotlib' un moyen de faire fonctionner la magie iPython? – Angletear