-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtwo.py
91 lines (49 loc) · 1.18 KB
/
two.py
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
#!/usr/bin/env python
# coding: utf-8
# In[12]:
import astropy
import pandas as pd
# In[13]:
def plot():
df = pd.read_csv("data.csv")
# In[18]:
rs= []
for i in range(274):
rs.append(df.loc[:, "Column 7"][i])
ebv= []
for i in range(274):
ebv.append(df.loc[:, "Column 10"][i])
idi= []
for i in range(274):
idi.append(df.loc[:, "Column 1"][i])
distmod= []
for i in range(274):
distmod.append(df.loc[:, "Column 9"][i])
# In[19]:
ratio = []
for i in range(274):
ratio.append(rs[i] + 1)
# In[20]:
distance = []
for i in range(274):
x = (distmod[i] + 5)/5
distance.append(10**x)
# In[23]:
from plotly.offline import iplot
# In[24]:
import plotly.plotly as py
import plotly.graph_objs as go
# In[25]:
trace = go.Scatter(
x = ratio,
y = distmod,
mode = "markers"
)
# In[26]:
data = [trace,]
a = []
for i in range(274):
if (rs[i] < 0.000847):
a.append(idi[i]+1)
a = "The sources which lie inside Milky way are: " + ", ".join(map(str, a))
return data, a