有沒(méi)有辦法解決字典理解問(wèn)題?bmcdsreg = {}for key, val in bms.iteritems(): bmcdsreg[key] = {} for reg in bmmaps.columns: bmcdsreg[key][reg]= val*bmmaps[reg]我有以下密鑰互換的版本:bmcdsreg = {reg: {key: val*bmmaps[reg] for key, val in bms.iteritems()} for reg in bmmaps.columns}
Python中的字典理解
當(dāng)年話下
2023-02-07 16:29:48