当前位置:网站首页>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。
边栏推荐
- With the continuous waves of infringement, the U.S. patent and trademark office began to study the impact of NFT on copyright
- Deployment之滚动更新策略。
- 通过Jenkins 拉取服务器代码 权限不足问题及其他注意事项
- Minimally invasive electrophysiology has passed the registration: a listed enterprise with annual revenue of 190million minimally invasive mass production
- 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
- Developing NES games with C language (cc65) 09, scrolling
- 【vulnhub】presidential1
- GMT安装与使用
- 行业落地呈现新进展 | 2022 开放原子全球开源峰会 OpenAtom OpenHarmony 分论坛圆满召开
- 遭受痛苦和创伤后的四种本真姿态 齐泽克
猜你喜欢

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

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

Minimally invasive electrophysiology has passed the registration: a listed enterprise with annual revenue of 190million minimally invasive mass production

Newly released, the domestic ide developed by Alibaba is completely open source

新东方单季营收5.24亿美元同比降56.8% 学习中心减少925间

设计一个线程池

Introduction to resttemplate

Ten prohibitions for men and women in love

Developing NES game (cc65) 07 and controller with C language

Did kafaka lose the message
随机推荐
金九银十 再不卷就来不及了
HMS core audio editing service supports 7 kinds of audio effects to help one-stop audio processing
Newly released, the domestic ide developed by Alibaba is completely open source
GMT installation and use
用C语言开发NES游戏(CC65)02、什么是v-blank?
Laravel form data validation
奥浦迈生物通过注册:半年营收1.47亿 国寿成达与达晨是股东
Developing NES game (cc65) 07 and controller with C language
Redis implements distributed locks
公司在什么情况下可以开除员工
sqli-labs(less-8)
Uniapp wechat applet realizes the function of connecting low-power Bluetooth printing
Under what circumstances can the company dismiss employees
AVL tree (balanced search tree)
Zadig v1.13.0 believes in the power of openness, and workflow connects all values
用C语言开发NES游戏(CC65)07、控制器(和精灵碰撞)
Jinshanyun rushes to the dual main listing of Hong Kong stocks: the annual revenue of 9billion is a project supported by Lei Jun
用C语言开发NES游戏(CC65)05、调色板
Open source database innovation in the era of digital economy | the 2022 open atom global open source summit database sub forum was successfully held
洪九果品通过聆讯:5个月经营利润9亿 阿里与中国农垦是股东