numpyの次の文字列をshape=(5, 1)に変換しようとすると、shape=(1,5)になってしまします。
python
1# [image_path, x1, y1, x2, y2, class_id] 2df = ['2007_000027.jpg', '174', '101', '349', '351', '14', 3 '2007_000027.jpg', '174', '101', '349', '351', '14'] 4for d in df: 5 d=d.strip().split(',') 6 box = np.array([np.array(list(map(int,box.split(',')))) for box in d[1:]]) 7 8Box 9>>> 10[[174], 11[101], 12[349], 13[351], 14[14]]
それを次のように
python
1[[174],[101], [349], [351], [14]]
reshapeを使用せず、shape=(5, 1)の形にするにはどうしたら良いでしょうか?
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2020/01/13 12:10
2020/01/13 12:20 編集