当前位置:网站首页>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.
边栏推荐
- STM32F103 几个特殊引脚做普通io使用注意事项以及备份寄存器丢失数据问题1,2
- Block reversal (summer vacation daily question 7)
- 新零售电商O2O模式解析
- GMT installation and use
- 力扣315计算右侧小于当前元素的个数
- The usage and Simulation Implementation of vector in STL
- 机器学习实战-逻辑回归-19
- 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
- scala 转换、过滤、分组、排序
- 图书馆自动预约脚本
猜你喜欢

Uncover why devaxpress WinForms, an interface control, discards the popular maskbox property

快速读入

The usage and Simulation Implementation of vector in STL

Unity 安装 Device Simulator

AVL tree (balanced search tree)

连通块&&食物链——(并查集小结)

Hongjiu fruit passed the hearing: five month operating profit of 900million Ali and China agricultural reclamation are shareholders

微创电生理通过注册:年营收1.9亿 微创批量生产上市企业

Leetcode: array

Distributed session solution
随机推荐
SuperMap iclient3d for webgl to realize floating thermal map
Siemens docking Leuze BPS_ 304i notes
界面控件Telerik UI for WPF - 如何使用RadSpreadsheet记录或评论
The 'name' attribute value associated with the element type 'item' cannot contain '& lt;' Character solution
Initialization examples of several modes of mma8452q
GMT installation and use
十三. 实战——常用依赖的作用
Leetcode:704 binary search
Vs code is not in its original position after being updated
Review the IO stream again, and have an in-depth understanding of serialization and deserialization
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
1331. 数组序号转换 : 简单模拟题
上位机和三菱FN2x通信实例
Redis implements distributed locks
Unity加载Glb模型
输入字符串,内有数字和非字符数组,例如A123x456将其中连续的数字作为一个整数,依次存放到一个数组中,如123放到a[0],456放到a[1],并输出a这些数
mysql limit 分页优化
Science 重磅:AI设计蛋白质再获突破,可设计特定功能性蛋白质
【Base】优化性能到底在优化啥?
洪九果品通过聆讯:5个月经营利润9亿 阿里与中国农垦是股东