数字のセット
n_set = [1.0,3.2,4.5,8.2,1.3,2.2,5.6,9.8,2.4,5.5,6.7]
だから私は一連の数値を取り、数値セットからリストのリストを作成する関数を構築しようとしています。各リストに、元のセットから最大値に達するまで増加する数値のサブセットを持たせようとしています
organized_set = [[1.0,3.2,4.5,8.2],[1.3,2.2,5.6,9.8],[2.4,5.5,6.7]]
私はその線に沿って何かを考えていました
for i,k in zip(range(0,len(n_set)),n_set):
set = []
d = dict(zip(i,k))
d2 = dict(zip(k,i))
if d[i] < d[d2[i]+1]:
set.append(k)
これは意味がありません。私ははるかに複雑な機能に取り組んでいますが、これは私を悩ませているその一部です。どんな助けでも喜んでいただければ幸いです