In [1]:
import numpy as np
import pandas as pd
import cufflinks as cf
from plotly.offline import download_plotlyjs, init_notebook_mode
from plotly.offline import plot, iplot
#set notebook mode
init_notebook_mode(connected=True)
cf.go_offline()
In [2]:
df = pd.DataFrame(np.random.randn(100,4),
columns='A B C D'.split(' '))
df.head()
Out[2]:
In [3]:
df2 = pd.DataFrame({'category':['A','B','C'], 'values':[33,56,67]})
df2
Out[3]:
In [4]:
df.iplot()
In [5]:
df2.iplot(kind='bar')
In [6]:
df.iplot(kind='box')
In [7]:
df3 = pd.DataFrame({'x':[1,2,3,4,5],
'y':[11,22,33,44,55],
'z':[5,4,3,2,1]})
df3
Out[7]:
In [8]:
df3.iplot(kind='surface')
In [9]:
df.iplot(kind='hist',bins=50)
In [12]:
df[['A','B']].iplot(kind='spread')
In [16]:
df.iplot(kind='bubble',x='A', y='B', size='C')
In [17]:
df.scatter_matrix()