-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcufflinks.py
More file actions
74 lines (41 loc) · 1.25 KB
/
cufflinks.py
File metadata and controls
74 lines (41 loc) · 1.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#!/usr/bin/env python
# coding: utf-8
# In[1]:
import cufflinks as cf
import plotly.graph_objs as go
import plotly.offline as pyo
import pandas as pd
import numpy as np
cf.go_offline()
# In[2]:
x1 =[1,2,3,4,5]
y1 = [10,20,30,40,50]
z1= [5,4,3,2,1]
dataset = pd.DataFrame({'id':x1,'name':y1,'remarks':z1})
dataset.iplot(kind='surface')
# In[3]:
df = pd.DataFrame(np.random.randn(200, 2), columns=['X', 'Y']).cumsum()
fig = df.iplot(asFigure=True, xTitle="The X Axis",
yTitle="The Y Axis", title="The Figure Title")
pyo.plot(fig,filename='timeseries.html')
fig.show()
# In[4]:
df = pd.DataFrame(np.random.rand(10, 4), columns=['A', 'B', 'C', 'D'])
fig = df.iplot(asFigure=True, kind="bar")
pyo.plot(fig,filename='bar.html')
fig.show()
# In[5]:
df = pd.DataFrame({'a': np.random.randn(500) + 1,'b': np.random.randn(500),'c': np.random.randn(500) - 1})
fig = df.iplot(asFigure=True, kind="histogram")
pyo.plot(fig,filename='histogram.html')
fig.show()
# In[6]:
fig = df.iplot(asFigure=True, kind="box")
pyo.plot(fig,filename='boxplot.html')
fig.show()
# In[7]:
df=cf.datagen.lines(5)
fig = df.iplot(asFigure=True, subplots=True, shape=(5,1), shared_xaxes=True, fill=True)
pyo.plot(fig,filename='timeseries.html')
fig.show()
# In[ ]: