我以前在数据帧中使用'select'属性,但是已弃用。找不到我收到的错误的任何细节,我们将不胜感激任何指导/帮助。
exports: [MatCheckboxModule]
发生异常:TypeError 通话()为参数“ axis”获得了多个值
答案 0 :(得分:1)
好像您需要apply
而不是loc
df = df.apply(lambda x: not re.search('\d+_version_value', x), axis=1)
答案 1 :(得分:0)
您可以尝试以下方法吗?-用方括号括起来:
df=df.loc[lambda x: not re.search('\d+_version_value', x.column)]
答案 2 :(得分:0)
摘自已弃用的select
的熊猫文档:
从0.21.0版开始弃用:使用
n = 10000
通过标签进行选择
所以,尝试这样的事情:
df.loc[df.index.map(crit)]
或者,如果您尝试选择列:
df.loc[df.index.map(lambda x: not re.search('\d+_version_value', x))]
示例:
df.loc[:, df.columns.map(lambda x: not re.search('\d+_version_value', x))]
print(df.head())
sepalLength sepalWidth petalLength petalWidth species
0 5.1 3.5 1.4 0.2 setosa
1 4.9 3.0 1.4 0.2 setosa
2 4.7 3.2 1.3 0.2 setosa
3 4.6 3.1 1.5 0.2 setosa
4 5.0 3.6 1.4 0.2 setosa