我正在使用代码,并生成如下输出。
码
User_info = {
1: ["Rita","delhi",47,47,38],
2: ["Sita","DElhi",49,28,40],
3: ["geeta","Mumbai",38,50,38],
4: ["Geeta","MUMBAI",28,26,44],
5: ["GEETA","CHENNAI",30,36,36],
6: ["SITA","chennai",37,28,34]
}
print ("{:<10} {:<10} {:<20} {:<20} {:<20}".format('Name', 'Location', 'W1', 'W2', 'W3'))
for key, value in User_info.items():
name, location, w1, w2, w3 = value
print ("{:<10} {:<10} {:<20} {:<20} {:<20}".format(name, location, w1*1.609, w2*1.609, w3*1.609))
输出值
我的要求是想使用applymap函数将“名称”和“位置”列的值更改为上
问候,
巴拉斯·维卡斯
如果需要打印值:
for key, value in User_info.items():
name, location, w1, w2, w3 = value
print ("{:<10} {:<10} {:<20} {:<20} {:<20}".format(name.upper(), location.upper(), w1*1.609, w2*1.609, w3*1.609))
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句