当前位置:网站首页>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 12:52:00 【Lazy smile】
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(

explain :FutureWarning: Index multiple keys ( Tuples implicitly converted to keys ) Will be abandoned , Use a list instead of .
The initial code :
temp_data = data[data['Sex'] == 'F'].groupby(['Sport'])['Age', 'Height', 'Weight'].mean().reset_index().dropna(
how='any')solve :
temp_data = data[data['Sex'] == 'F'].groupby(['Sport'])[['Age', 'Height', 'Weight']].mean().reset_index().dropna(
how='any')Solutions :
hold
['Age', 'Height', 'Weight']
Change to
[['Age', 'Height', 'Weight']]
This warning is on pandas 1.0.0 Introduction in .groupby Method is followed by double brackets , Single brackets are used to output Pandas series , Double brackets are used for output Pandas DataFrame.
边栏推荐
猜你喜欢

Which big model is better? Openbmb releases bmlist to give you the answer!

Ccf201912-2 recycling station site selection

Initialization examples of several modes of mma8452q

Vs code is not in its original position after being updated

界面控件Telerik UI for WPF - 如何使用RadSpreadsheet记录或评论

大模型哪家强?OpenBMB发布BMList给你答案!

GMT安装与使用

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

揭秘界面控件DevExpress WinForms为何弃用受关注的MaskBox属性

leetcode:数组
随机推荐
Science 重磅:AI设计蛋白质再获突破,可设计特定功能性蛋白质
Sliding Window
Merge table rows - three levels of for loop traversal data
20220728-Object类常用方法
金山云冲刺港股拟双重主要上市:年营收90亿 为雷军力挺项目
区块反转(暑假每日一题 7)
机器学习实战-逻辑回归-19
Which big model is better? Openbmb releases bmlist to give you the answer!
DART 三维辐射传输模型申请及下载
一台电脑上 多个项目公用一个 公私钥对拉取gerrit服务器代码
Leetcode206 reverse linked list
LeetCode94. 二叉树的中序遍历
VS code更新后不在原来位置
云原生—运行时环境
AI制药的数据之困,分子建模能解吗?
【Base】优化性能到底在优化啥?
The largest rectangle in leetcode84 histogram
MySQL is always installed unsuccessfully. Just do it like this
Fastjson parses multi-level JSON strings
快速读入