所以我可以做类似的事情:
data = df[ df['Proposal'] != 'C000' ]
删除所有带有字符串C000的投标,但是我该怎么做:
data = df[ df['Proposal'] not in ['C000','C0001' ]
删除所有与C000或C0001相匹配的投标(等,等等)
答案 0 :(得分:1)
您可以尝试一下,
TypeError: reduction operation 'argmin' not allowed for this dtype
或者选择所需的内容,
df = df.drop(df[df['Proposal'].isin(['C000','C0001'])].index)
答案 1 :(得分:0)
import numpy as np
data = df.loc[np.logical_not(df['Proposal'].isin({'C000','C0001'})), :]
# or
data = df.loc[ ~df['Proposal'].isin({'C000','C0001'}) , :]