I have this dataframe
id value
high 3
medium 2
low 1
NaN
service
complex
high 5
medium 4
low 3
and what I want to do is to keep the row that contains high, medium, low only. So I expect my dataframe would become:
id value
high 3
medium 2
low 1
high 5
medium 4
low 3
what I have tried is using str.contains
df[df['id'].str.contains('high', 'medium', 'low')]
but it gives me error TypeError: unsupported operand type(s) for &: 'str' and 'int'
how can I do that with pandas?
thanks in advance