当前位置:网站首页>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。
边栏推荐
- Unity 安装 Device Simulator
- Kuzaobao: summary of Web3 encryption industry news on July 13
- PHP gets all the dates of this week or the last seven days
- Under what circumstances can the company dismiss employees
- IRBuilder
- 用C语言开发NES游戏(CC65)07、控制器
- First in the country! The two standards of "data product registration" formulated by insight technology and Shandong data were officially released
- Fusion cloud native, enabling new mileage | 2022 open atom global open source summit cloud native sub forum successfully held
- Developing NES games (cc65) 05 and palette with C language
- Yan Ji lost Beijing again, and more than half of the stores in the country were closed
猜你喜欢

Design a thread pool

洪九果品通过聆讯:5个月经营利润9亿 阿里与中国农垦是股东

If you don't roll the golden nine and silver ten, it's too late

FlexPro软件:生产、研究和开发中的测量数据分析

Zadig v1.13.0 believes in the power of openness, and workflow connects all values

DIY system home page, your personalized needs PRO system to meet!
![[dark horse morning post] LETV 400 employees have no 996 and no internal papers; Witness history! 1 euro =1 US dollar; Stop immediately when these two interfaces appear on wechat; The crackdown on cou](/img/d7/4671b5a74317a8f87ffd36be2b34e1.jpg)
[dark horse morning post] LETV 400 employees have no 996 and no internal papers; Witness history! 1 euro =1 US dollar; Stop immediately when these two interfaces appear on wechat; The crackdown on cou

Developing NES games with C language (cc65) 08. Background collision

C for循环内定义int i变量出现的重定义问题

新零售电商O2O模式解析
随机推荐
[Nuxt 3] (十二) 项目目录结构 3
Uniapp wechat applet realizes the function of connecting low-power Bluetooth printing
用C语言开发NES游戏(CC65)03、VRAM缓冲区
SQL injection LESS18 (header injection + error injection)
公司在什么情况下可以开除员工
Open source office (ospo) unveils Secrets
用arduino开发ESP8266 搭建开发环境
Four authentic postures after suffering and trauma, Zizek
Not optimistic about Apple making AR, Luo Yonghao: I'll do it myself
Analysys analysis: focus on users, improve the user experience of mobile banking, and help the growth of user value
Use json.stringify() to format data
Kuzaobao: summary of Web3 encryption industry news on July 13
洪九果品通过聆讯:5个月经营利润9亿 阿里与中国农垦是股东
What if the instruction set umi2 is missing? PTK installation cannot be carried out
用C语言开发NES游戏(CC65)02、什么是v-blank?
【vulnhub】Raven2
[try to hack] UDF raises rights
一台电脑上 多个项目公用一个 公私钥对拉取gerrit服务器代码
PHP gets all the dates of this week or the last seven days
恋爱男女十禁