Я использую приведенный ниже код.
import pandas as pd
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]
}
Output = pd.DataFrame([
[name.upper(), location.upper(), w1*1.609, w2*1.609, w3*1.609]
for name, location, w1, w2, w3 in User_info.values()
], columns=['Name', 'Location', 'W1', 'W2', 'W3'])
updated = Output.append(df.sum().rename('Total')).assign(Total=lambda d: d.sum(0))
updated
Вывод
I Would like to see the output like below
введите описание изображения здесь
С уважением,
Бхарат Викас