In [1]:
import pandas as pd
import numpy as np
%matplotlib inline
from plotly.offline import download_plotlyjs, init_notebook_mode, plot, iplot
import cufflinks as cf
init_notebook_mode(connected=True)
cf.go_offline()
In [2]:
df1 = pd.DataFrame(np.random.randn(100,4),columns='A B C D'.split())
df2 = pd.DataFrame({'Category':['A','B','C'],'Values':[32,43,50]})
In [4]:
df1.iplot()
Using Cufflinks and iplot()¶
- scatter
- bar
- box
- spread
- ratio
- heatmap
- surface
- histogram
- bubble
In [23]:
df1.iplot(kind='scatter',x='A',y='B')
In [24]:
df1.iplot(kind='scatter',x='A',y='B',mode='markers')
In [10]:
df1.iplot(kind='scatter',x='A',y='B',mode='markers',size=10)
In [25]:
df2.iplot(kind='bar',x='Category',y='Values')
In [26]:
df1.iplot(kind='bar')
In [27]:
df1.count().iplot(kind='bar')
In [28]:
df1.sum().iplot(kind='bar')
In [29]:
df1.iplot(kind='box')
In [30]:
df3 = pd.DataFrame({'x':[1,2,3,4,5],'y':[10,20,30,20,10],'z':[5,4,3,2,1]})
df3.iplot(kind='surface')
In [18]:
df3.iplot(kind='surface',colorscale='rdylbu')
In [31]:
df3 = pd.DataFrame({'x':[1,2,3,4,5],'y':[10,20,30,20,10],'z':[500,400,300,200,100]})
df3.iplot(kind='surface')
In [32]:
df1['A'].iplot(kind='hist',bins=25)
In [33]:
df1['A'].iplot(kind='hist',bins=40)
No comments:
Post a Comment