Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
特別な値 (-999) を避けて、リスト内で各リストの値の平均を個別に計算する方法は?
A = [[4,5,7,8,-999],[3,8,5,7,-999]] M = [sum(x)/len(x) for x in [y for y in A if y!= -999] print (M)
何か案が ???
最高の速度のために: 誰かが次のコードを修正できますか? @alexanderlukanin13
M = [np.mean(L [L!=-999])for L in A]