当前位置:网站首页>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。
边栏推荐
- 用C语言开发NES游戏(CC65)03、VRAM缓冲区
- Developing NES games (cc65) 05 and palette with C language
- Developing NES games with C language (cc65) 08. Background collision
- Distributed timer
- How to build knowledge management system in enterprises and institutions
- 用C语言开发NES游戏(CC65)05、调色板
- Minimally invasive electrophysiology has passed the registration: a listed enterprise with annual revenue of 190million minimally invasive mass production
- Laravel $object->updated_ At returns the carbon object. How to return the normal time format
- PHP timestamp subtraction converts to days, hours, minutes and seconds
- 行业落地呈现新进展 | 2022 开放原子全球开源峰会 OpenAtom OpenHarmony 分论坛圆满召开
猜你喜欢

Implementation method of mouse hover, click and double click in ue4/5

Come to tdengine Developer Conference and have an insight into the future trend of data technology development

Uninstall Navicat: genuine MySQL official client, really fragrant!

Redis实现分布式锁

Industry, University, research and application jointly build an open source talent ecosystem | the 2022 open atom global open source summit education sub forum was successfully held

Tencent two sides: @bean and @component are used in the same class, what will happen?

Developing NES games with C language (cc65) 10. Game cycle

软件架构师必需要了解的 saas 架构设计?

Developing NES games with C language (cc65) 11. Metatiles

AVL树(平衡搜索树)
随机推荐
金九银十 再不卷就来不及了
Localization, low latency, green and low carbon: Alibaba cloud officially launched Fuzhou data center
Developing NES games with C language (cc65) 10. Game cycle
Hongjiu fruit passed the hearing: five month operating profit of 900million Ali and China agricultural reclamation are shareholders
On Governance and innovation | the openanolis sub forum of the 2022 open atom global open source summit was successfully held
Laravel form data validation
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
Deployment之滚动更新策略。
Uninstall Navicat: genuine MySQL official client, really fragrant!
PHP date time application: add or subtract the number of days of a specific date
数字经济时代的开源数据库创新 | 2022 开放原子全球开源峰会数据库分论坛圆满召开
用C语言开发NES游戏(CC65)06、精灵
一台电脑上 多个项目公用一个 公私钥对拉取gerrit服务器代码
PHP ⽉ the simplest way to add and subtract ⽅
Kafaka丢消息吗
Newly released, the domestic ide developed by Alibaba is completely open source
[try to hack] intranet Foundation
新东方单季营收5.24亿美元同比降56.8% 学习中心减少925间
First in the country! The two standards of "data product registration" formulated by insight technology and Shandong data were officially released
用C语言开发NES游戏(CC65)10、游戏循环