1
果物とその量に関する3種類のデータがあります。自分のデータから「Apple」と「Pear」を除外したいが、以下のエラーが発生する。それはなぜそうですか?データから2つの文字列を除外します
import pandas as pd
df=(pd.DataFrame({'Fruit':['Apple','Orange','Pear','Apple','Orange']
,'Qty':[3,4,1,7,9]}))
df=df[df['Fruit'].str.contains('Apple'|'Pear')==False]
print(df)
TypeError: unsupported operand type(s) for |: 'str' and 'str'