質問編集履歴
2
コード中に関数の記述を追加
title
CHANGED
File without changes
|
body
CHANGED
@@ -6,6 +6,12 @@
|
|
6
6
|
(http://github.com/openmodal/pyuff/blob/master/pyuff.py)
|
7
7
|
コードの最初に次のように複素数データを格納するcsvファイルを作成しました。
|
8
8
|
```Python
|
9
|
+
def re(a,b):
|
10
|
+
c=a*math.cos(b*np.pi/180)
|
11
|
+
return c
|
12
|
+
def im(x,y):
|
13
|
+
z=x*math.sin(y*np.pi/180)
|
14
|
+
return z
|
9
15
|
v=[]
|
10
16
|
Mypath='makeufftest_x.csv'
|
11
17
|
with open(Mypath,encoding=("utf-8-sig")) as f:
|
1
csvファイルの詳細追加 エラーコードの表示
title
CHANGED
File without changes
|
body
CHANGED
@@ -40,16 +40,63 @@
|
|
40
40
|
```
|
41
41
|
自分で変更したコードはこの部分で後は特に変更しておりません。
|
42
42
|
#入力ファイル(一部)
|
43
|
+
```
|
44
|
+
makeufftest_x.csv
|
45
|
+
0.487436891 0
|
46
|
+
0.653218389 134.6398315
|
47
|
+
0.193872914 166.9507599
|
48
|
+
0.202087417 123.1289139
|
49
|
+
0.583534479 154.6550446
|
50
|
+
0.128547326 56.14105988
|
51
|
+
0.12943536 -154.5452881
|
52
|
+
0.3214885 177.0462799
|
53
|
+
0.029101485 138.5561066
|
54
|
+
0.192596287 -175.8987427
|
55
|
+
...
|
56
|
+
```
|
57
|
+
|
58
|
+
```
|
59
|
+
uffcomplex.csv
|
43
60
|
(0.487436891+0j)
|
44
61
|
(-0.4589825144147272+0.4647895385970837j) (-0.18886641385687497+0.04377424470730506j) (-0.11044575285292425+0.16923669751706533j) (-0.5273675102770167+0.2497919079674562j) (0.07162016248094702+0.1067472123661926j)
|
45
62
|
(-0.11687045992794481-0.05563099868382958j) (-0.32106139694892377+0.01656608044938813j) (-0.02181459622312576+0.019261874800424086j)
|
46
63
|
(-0.19210308907627732-0.013774357826709462j)
|
47
64
|
...
|
65
|
+
```
|
48
66
|
この複素数データが801個あります。
|
49
67
|
#現状
|
68
|
+
```Python
|
69
|
+
Traceback (most recent call last):
|
70
|
+
|
71
|
+
File "C:path\pyuff.py", line 474, in _read_set
|
72
|
+
si = self._blockInd[n][0] # start offset
|
73
|
+
|
74
|
+
IndexError: list index out of range
|
75
|
+
|
76
|
+
|
77
|
+
During handling of the above exception, another exception occurred:
|
78
|
+
|
79
|
+
Traceback (most recent call last):
|
80
|
+
|
81
|
+
File "C:path\pyuff.py", line 391, in read_sets
|
82
|
+
dset.append(self._read_set(ii))
|
83
|
+
|
84
|
+
File "C:path\pyuff.py", line 483, in _read_set
|
85
|
+
raise UFFException('Error reading data-set #: ' + int(n))
|
86
|
+
|
87
|
+
TypeError: can only concatenate str (not "int") to str
|
88
|
+
|
89
|
+
|
90
|
+
During handling of the above exception, another exception occurred:
|
91
|
+
|
92
|
+
Traceback (most recent call last):
|
93
|
+
|
94
|
+
File "C:path\pyuff.py", line 1654, in <module>
|
95
|
+
a = uff_ascii.read_sets(0)
|
50
96
|
raise UFFException('Error when reading data-set(s)')
|
51
97
|
|
52
98
|
UFFException: Error when reading data-set(s)
|
99
|
+
```
|
53
100
|
最後のif __name__ == '__main__':
|
54
101
|
の部分にcsvファイルを読み込ませるときにエラーが出てしまいます。
|
55
102
|
#試したこと
|