Jupyter Plotly Broken v3.0


Downgrade Plotly to version 2, 3.1.0 giving issues as https://github.com/santosjorge/cufflinks/issues/119

pip install 'plotly<=2.7.0'
pip install pandas xlrd
pip install cufflinks
import plotly.offline as pyo
#allows us to create the Data and Figure objects
from plotly.graph_objs import *
#plotly.plotly pushes your charts to the cloud  
import plotly.plotly as py
import plotly.figure_factory as ff
from plotly import tools
from plotly.figure_factory import create_table as tbl
import pandas as pd
import numpy as np
import warnings
import cufflinks as cf
df = pd.read_excel(Original-tweets_new.xlsx, 
                   sheet_name='Clean Data', encoding='utf-8')

senti_df = df[['Tweet', 'Annotation/Type', 'S/A']]
senti_df.iloc[:, 1:] = senti_df.iloc[:, 1:].apply(lambda x: x.str.lower())

senti_df.rename(columns={'Annotation/Type': 'Annotation'}, inplace=True)
 .iplot(kind='pie', labels='index', values='S/A', textinfo='value+percent', 
        pull=0.05, title='Distribution of Sentiments'))
© 2018 Nextjournal GmbH