python - 使用 Pandas 汇总数据
问题描述
我正在尝试过滤和汇总 Python 中的数据表。我正在努力选择年份(以“Y”开头的列)并计算该年每个国家/地区的平均值。下面是我尝试的最后一段代码。我很感激任何反馈:
我的 CSV 位于以下链接:
https://docs.google.com/spreadsheets/d/1e6R9Tse_Zt3AcY0pPAObdX5XVYKt6ZufHMG7nWLABMQ/edit?usp=sharing
areac= Temp_Change.columns.get_loc('Area')
monthc= Temp_Change.columns.get_loc[8:65]
df = Temp_Change.iloc[areac:monthc]
解决方案
推荐阅读
- regex - How to add spaces to any given string and maintain N chars?
- javascript - 使用 window.prompt() 在 java 脚本中创建一个数组
- vb.net - 使 checkbox.Checked = True 其对应的 PictureBox 被点击
- r - R plotly mesh3 通过原点的坐标线
- java - How to create multiWidget Form
- python - HaarCascade 训练:合并 .lst 文件
- flask-sqlalchemy - 如何对 flask-admin 数据库列执行操作以将结果存储在同一表的其他列中
- python - 使用自签名证书将 pip install 安装到私有 pypi 服务器时如何忽略引发的安全警告
- laravel - 如何配置 Laravel Passport 的 '/oauth/token' 速率限制?
- django - Markdown 模板无法正确呈现 HTML