回答編集履歴
2
Update
test
CHANGED
@@ -24,7 +24,7 @@
|
|
24
24
|
|
25
25
|
df = pd.read_csv("h2o_gaiaD_xmatch3arc.csv")
|
26
26
|
|
27
|
-
dfx =
|
27
|
+
dfx = df.apply(polar2cart, axis=1)
|
28
28
|
|
29
29
|
dfx.columns = ['x', 'y', 'z']
|
30
30
|
|
1
Update
test
CHANGED
@@ -9,6 +9,8 @@
|
|
9
9
|
def polar2cart(args):
|
10
10
|
|
11
11
|
theta, phi, r = args
|
12
|
+
|
13
|
+
theta *= math.pi / 180; phi *= math.pi / 180
|
12
14
|
|
13
15
|
return pd.Series([
|
14
16
|
|
@@ -34,10 +36,10 @@
|
|
34
36
|
|
35
37
|
#
|
36
38
|
|
37
|
-
|
39
|
+
x y z
|
38
40
|
|
39
|
-
0
|
41
|
+
0 10.633326 -6.619487 1121.780075
|
40
42
|
|
41
|
-
1
|
43
|
+
1 3.389362 4.965006 410.626998
|
42
44
|
|
43
45
|
```
|