下記のコードを書くと
AttributeError:'list' object has no attribute 'reshape'
が出てきます.
どこを直せばよいか教えてください.
import numpy as np import pandas as pd import decimal as dec from scipy import signal data = pd.read_csv("1_15403-23103_history.csv").values.tolist() list = [] filterrange = dec.Decimal(8) deltax = dec.Decimal(2) deltay = dec.Decimal(2) a = filterrange*filterrange/24 for j in range(2): for i in range(7597): a1 = dec.Decimal(data[i+51][j]) a2 = dec.Decimal(data[i+52][j]) a3 = dec.Decimal(data[i+53][j]) a4 = dec.Decimal(data[i+103][j]) a6 = dec.Decimal(data[i+1][j]) x = a2 + a*(((a3 - 2*a2 + a1)/(deltax*deltax)) + ((a4 - 2*a2 +a6)/(deltay*deltay))) list.append(x) #np.savetxt('filtered4_15403-23103_history.csv', list, delimiter=',') reshape = list.reshape(2,7597) np.savetxt('test.csv', reshape, delimiter=',')
回答2件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。