2012-01-08 18 views
2

私は1次元配列yを持ち、132300のエントリを持っています。SciPy.IO.wavfileでデータのndimに問題が発生しました

Traceback (most recent call last): 
File "C:\Users\Matt\The Mathematics Of Digital Synthesizers\Scripts\filter.py", line 47, in <module> 
write('440saw2000.wav', '44100', 'y') 
File "C:\Python27\lib\site-packages\scipy\io\wavfile.py", line 161, in write 
if data.ndim == 1: 
AttributeError: 'str' object has no attribute 'ndim' 

print y.ndim 

は、私は、書き込み( '440saw2000.wav'、 '44100'、 'Y')を使用する場合、私は次のエラーメッセージが表示され、私は今、1

を与えますどうすれば解決できますか?

ありがとうございました。

答えて

1

変数yの代わりに文字列 'y'をデータ引数として渡しています。

それはこのように動作するはずです:

write('440saw2000.wav', 44100, y) # without quotes around y and 44100 
+0

ありがとう非常に。私は明らかに非常に経験不足です! –

関連する問題