【发布时间】:2020-07-21 22:57:47
【问题描述】:
我正在尝试在我的数据框中删除行
栏目
Field:FacilityCode
mama100
mimba190
mama1
mimba67
#delete invalid code from df
df = df[~df['Field:FacilityCode'].str.len()>8] | df[~df['Field:FacilityCode'].str.len()>7]
预期输出
Field:FacilityCode
mama100
mimba190
这是错误
TypeError: ufunc 'invert' not supported for the input types, and the inputs could not be safely coerced to any supported types according to the casting rule ''safe'''
我该如何解决??
【问题讨论】: