当前位置:网站首页>FutureWarning: Indexing with multiple keys (implicitly converted to a tuple of keys) will be depreca
FutureWarning: Indexing with multiple keys (implicitly converted to a tuple of keys) will be depreca
2022-07-28 11:42:00 【懒笑翻】
FutureWarning: Indexing with multiple keys (implicitly converted to a tuple of keys) will be deprecated, use a list instead.
temp_data = data[data['Sex'] == 'F'].groupby(['Sport'])['Age', 'Height', 'Weight'].mean().reset_index().dropna(

解释:FutureWarning:索引多个键(隐式转换为键的元组)将被弃用,使用列表代替。
最初代码:
temp_data = data[data['Sex'] == 'F'].groupby(['Sport'])['Age', 'Height', 'Weight'].mean().reset_index().dropna(
how='any')解决:
temp_data = data[data['Sex'] == 'F'].groupby(['Sport'])[['Age', 'Height', 'Weight']].mean().reset_index().dropna(
how='any')解决思路:
把
['Age', 'Height', 'Weight']
改成
[['Age', 'Height', 'Weight']]
此警告在 pandas 1.0.0中引入。groupby方法后使用双括号,单括号用于输出Pandas系列,双括号用于输出Pandas DataFrame。
边栏推荐
- Develop NES game (cc65) 07 and controller with C language (collision with spirit)
- Not optimistic about Apple making AR, Luo Yonghao: I'll do it myself
- How can a novice quickly complete the establishment of a website? Come to the free "fitting room" experience
- Developing NES games with C language (cc65) 02. What is v-blank?
- 牛客网二叉树题解
- SuperMap itablet license module division
- Cache of laravel
- Developing NES games with C language (cc65) 10. Game cycle
- New Oriental's single quarter revenue was 524million US dollars, a year-on-year decrease of 56.8%, and 925 learning centers were reduced
- Tencent two sides: @bean and @component are used in the same class, what will happen?
猜你喜欢

Aopmai biological has passed the registration: the half year revenue is 147million, and Guoshou Chengda and Dachen are shareholders

用C语言开发NES游戏(CC65)10、游戏循环

Introduction to resttemplate

Ten prohibitions for men and women in love

Open source office (ospo) unveils Secrets

Foam exploded three times, why did Luo Yonghao put all his eggs in one basket to do ar?

Is it overtime to be on duty? Take up legal weapons to protect your legitimate rights and interests. It's time to rectify the working environment

论治理与创新 | 2022 开放原子全球开源峰会 OpenAnolis 分论坛圆满召开

First in the country! The two standards of "data product registration" formulated by insight technology and Shandong data were officially released

Configure jupyter remote server
随机推荐
SQL injection LESS18 (header injection + error injection)
Kafaka丢消息吗
Library automatic reservation script
【vulnhub】presidential1
【Base】优化性能到底在优化啥?
Deployment之滚动更新策略。
【萌新解题】爬楼梯
Marketing play is changeable, and understanding the rules is the key!
Arduino Pro Mini atmega328p connect and light the first LED (at the same time, record the problem of burning failure stk500_recv)
用C语言开发NES游戏(CC65)11、Metatiles
Minimally invasive electrophysiology has passed the registration: a listed enterprise with annual revenue of 190million minimally invasive mass production
Baidu map API adds information window circularly. The window only opens at the last window position and the window information content is the same solution
The usage and Simulation Implementation of vector in STL
First in the country! The two standards of "data product registration" formulated by insight technology and Shandong data were officially released
Unity 安装 Device Simulator
开源汇智创未来 | 2022 开放原子全球开源峰会 OpenAtom openEuler 分论坛圆满召开
Let Arduino support nuvotom Xintang
Introduction to several methods of keeping two decimal places in PHP
Ten prohibitions for men and women in love
用C语言开发NES游戏(CC65)02、什么是v-blank?