d = {'a': [1, 2], 'b': [1]}# --->d={'b':[1],'a':[1,2]}
feature_d_ = {} for feature in feature_complete_l: feature_d_[feature] = feature_d[feature] del feature_d feature_d = feature_d_