【发布时间】:2026-01-17 14:55:01
【问题描述】:
From country Austria Belgium Denmark France Germany Italy Luxembourg Switzerland The Netherlands United Kingdom
Austria 0 0 0 0 0 0 3 0 6 1
Belgium 0 0 0 2 1 1 0 0 5 1
Denmark 0 2 0 2 0 1 0 2 3 0
France 0 0 0 0 6 0 0 0 4 0
Germany 0 2 0 6 0 0 0 1 1 0
Italy 0 0 3 0 1 0 4 1 1 0
Luxembourg 0 0 0 4 0 1 0 1 3 1
Switzerland 0 1 0 0 0 0 0 0 7 2
The Netherlands 1 0 5 1 0 2 0 0 0 1
United Kingdom 2 0 2 2 0 2 1 0 1 0
这里我有一个表,其中的值是从一个国家分配到一个国家的列上的点。我总共有 60 个表,我正在尝试创建一个看起来相同但值是所有 60 个表的平均值的最终表。我无法在 pandas 或堆栈交换的其他地方找到任何函数来平均每个值,就像我正在尝试做的那样,我该如何解决这个问题?
PS:在某些表格中,国家或多或少
【问题讨论】:
-
所有表都在文件中?
-
是的,它们都在一个 xlsx 文件中,我正在使用 pd.read_excel() 将其加载到数据帧中
标签: python excel pandas dataframe average