当前位置:网站首页>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.
边栏推荐
- [apue] 文件中的空洞
- Minimally invasive electrophysiology has passed the registration: a listed enterprise with annual revenue of 190million minimally invasive mass production
- 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
- Detailed explanation of the usage of C # static
- Uncover why devaxpress WinForms, an interface control, discards the popular maskbox property
- AVL tree (balanced search tree)
- 04 pyechars 地理图表(示例代码+效果图)
- Developing NES game (cc65) 03 and VRAM buffer with C language
- 上位机和三菱FN2x通信实例
- Analysis of new retail e-commerce o2o model
猜你喜欢
随机推荐
Review the IO stream again, and have an in-depth understanding of serialization and deserialization
Leetcode 1518. wine change
MMA8452Q几种模式的初始化实例
04 pyechars 地理图表(示例代码+效果图)
Linear classifier (ccf20200901)
第九章 REST 服务安全
机器学习基础-支持向量机 SVM-17
[half understood] zero value copy
Ccf201912-2 recycling station site selection
The usage and Simulation Implementation of vector in STL
Fastjson parses multi-level JSON strings
LeetCode94. 二叉树的中序遍历
20220728-Object类常用方法
New progress in the implementation of the industry | the openatom openharmony sub forum of the 2022 open atom global open source summit was successfully held
Marketing play is changeable, and understanding the rules is the key!
SuperMap itablet license module division
非标自动化设备企业如何借助ERP系统,做好产品质量管理?
Siemens docking Leuze BPS_ 304i notes
SuperMap iclient3d for webgl to realize floating thermal map
LeetCode 42.接雨水









