Difference makes the DIFFERENCE
!pip install chart_studio
import pandas as pd
import numpy as np
import cufflinks as cf
from plotly.offline import download_plotlyjs, iplot, plot, init_notebook_mode
init_notebook_mode(connected=True)
cf.go_offline()
df = pd.DataFrame(np.random.rand(100, 4), columns='a b c d'.split())
df2 = pd.DataFrame({"Category": ["one", "two", "three"], "Count":[10, 20, 12]})
def configure_plotly_browser_state():
import IPython
display(IPython.core.display.HTML('''
<script src="/static/components/requirejs/require.js"></script>
<script>
requirejs.config({
paths: {
base: '/static/base',
plotly: 'https://cdn.plot.ly/plotly-latest.min.js?noext',
},
});
</script>
'''))
df.plot()
configure_plotly_browser_state()
df.iplot()
configure_plotly_browser_state()
df.iplot(kind="scatter", x='c', y='b', mode = 'markers', size = 5, color = 'red')
configure_plotly_browser_state()
df.iplot(kind='bar')
configure_plotly_browser_state()
df.mean().iplot(kind = 'bar', bins=20)
configure_plotly_browser_state()
df.iplot(kind='box')
#for surface plots in 3d
df3 = pd.DataFrame({'x':[1,2,3,4,5,6], 'y':[10,20,30,40,50,60], 'z':[120, 210, 130, 310, 410, 140]})
configure_plotly_browser_state()
df3.iplot(kind='surface', colorscale="ylgnbu")
configure_plotly_browser_state()
df['a'].iplot(kind = 'hist', bins=25)
configure_plotly_browser_state()
df.iplot(kind='hist', bins = 25)
configure_plotly_browser_state()
df[['a', 'b']].iplot(kind='spread')