成功解决TypeError: drop() missing 1 required positional argument: 'labels'

简介: 成功解决TypeError: drop() missing 1 required positional argument: 'labels'

解决问题


TypeError: drop() missing 1 required positional argument: 'labels'




解决思路


类型错误:drop()缺少1个必需的位置参数:“labels”





解决方法


是因为drop()函数的调用方法,必须有参数labels='某个字段',指定即可!

(1)、也可以尝试去掉drop函数直接输出!


split_cv[ predictions != cv_df.as_matrix()[:,0] ].drop()

split_cv[ predictions != cv_df.as_matrix()[:,0] ]

 


目录
打赏
0
0
0
0
1043
分享
相关文章
成功解决TypeError: ‘encoding’ is an invalid keyword argument for this function
成功解决TypeError: ‘encoding’ is an invalid keyword argument for this function
|
8月前
|
【Python】已解决:TypeError: *init*() missing 1 required positional argument: ‘scheme’
【Python】已解决:TypeError: *init*() missing 1 required positional argument: ‘scheme’
478 0
成功解决TypeError: __init__() got an unexpected keyword argument 'serialized_options'
成功解决TypeError: __init__() got an unexpected keyword argument 'serialized_options'
TypeError: custom() got an unexpected keyword argument ‘path‘
TypeError: custom() got an unexpected keyword argument ‘path‘
186 0
报错 ValueError: too many values to unpack (expected 2)
报错 ValueError: too many values to unpack (expected 2)
265 0
解决TypeError: tf__update_state() got an unexpected keyword argument ‘sample_weight‘
解决TypeError: tf__update_state() got an unexpected keyword argument ‘sample_weight‘
315 0
解决TypeError: tf__update_state() got an unexpected keyword argument ‘sample_weight‘
python TypeError: missing 1 required positional argument:'self'
python TypeError: missing 1 required positional argument:'self'
python TypeError: missing 1 required positional argument:'self'
ValueError: not enough values to unpack (expected 3, got 2)
这个错误通常是因为在解包(unpacking)元组(tuple)时,元组中的元素数量与期望不符,导致无法将所有元素正确解包。 例如,在以下代码中,元组中只有两个元素,但我们尝试将其解包为三个变量:
738 0
error: passing ‘const AppJniCommand’ as ‘this’ argument discards qualifiers [-fpermissive]
error: passing ‘const AppJniCommand’ as ‘this’ argument discards qualifiers [-fpermissive]
121 0