Pandasを用いてfor文を使用したところ、
以下のコードは実行されるのに対し、
以下のコードを実行すると
Python
1for j in range(1, 9): 2 list_a = [a1, a2, a3, a4] 3 a1_f, a2_f, a3_f, a4_f = [fft(i.iloc[:,j-1], len(i.iloc[:,j-1]), 125) for i in list_a] 4 list_b = [a1_f, a2_f, a3_f, a4_f] 5 6 7 features_df = pd.DataFrame() 8 features_df[j] = [i[0] for i in list_b]
# 実行結果 8 0 a1の1列目のデータ 1 a2の1列目のデータ 2 a3の1列目のデータ 3 a4の1列目のデータ # 想定される結果 1 2 8 0 a1の1列目のデータ a1の2列目のデータ ・・・ a1の8列目のデータ 1 a2の1列目のデータ a2の2列目のデータ ・・・ a2の8列目のデータ 2 a3の1列目のデータ a3の2列目のデータ ・・・ a3の8列目のデータ 3 a4の1列目のデータ a4の2列目のデータ ・・・ a4の8列目のデータ
どのように改善したらよいでしょうか。
よろしくお願い致します。
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2018/01/08 15:33