私は(numpyのを使用して)、次のような何かをしようとするだろう
...あなたの質問はpyhtonに関しては想定しています
import numpy as np
initial_list = [[928.7, 554.29999958311, 0],
[928.7, 558.15990063549, 0],
[914.1, 558.15990063549, 0],
[914.1, 554.29999958311, 0]]
# transform the list in a numpy array
a = np.array(initial_list)
# remove the column you want and put the output in a new variable
a1 = np.delete(a, 0, 1) # this would the remove the first column(0)
#+the second "1" in the arguments tells to
#+numpy to delete the column instead of the
#+ row.
# convert back to a plain list
final_list = a1.tolist()
あなたは無地のpythonで滞在したい場合は、私のようなものをお勧めします:
initial_list = [[928.7, 554.29999958311, 0],
[928.7, 558.15990063549, 0],
[914.1, 558.15990063549, 0],
[914.1, 554.29999958311, 0]]
for row in initial_list:
del row[0] # This would delete the first column from your matrix
final_list = initial_list
後者の方法で元のリストを上書きし、すべての削除済みデータを失うことに注意してください。必要に応じて、initial_listのコピーを作成することを検討してください。
希望すると便利です。
この回答は確かに少し説明する価値があります! –
いい仕事です!それのような素晴らしいOPを願っています;) –