here is the example of the question import pandas as pd df = pd.read_excel("C:/' , top_products)
df['sales'] = df['price'] * df['quantity']
The_most_money_spent= df.groupby
尝试汇总pandas数据帧,并根据原始df的groupby结果计算"percent of total“列。我不确定我是否正确地访问了groupby结果,可能没有理解它是什么(一个系列?)。df = pd.DataFrame(narr, columns=['LU','Shape_Area'])
#to print the ex