Python 如果pandas列中只有单词,如何在pandas数据框中删除行

Python 如果pandas列中只有单词,如何在pandas数据框中删除行,python,pandas,Python,Pandas,如果列中有一个项目只有一个字,我们如何在数据框中删除整行 例如: 'the cat likes mice', 'the dog likes the cat', 'dog' 返回 'the cat likes mice', 'the dog likes the cat' 使用pd.Series.str.contains方法查找空格如何: df = pd.DataFrame({'items': ['the cat likes mice',

如果列中有一个项目只有一个字,我们如何在数据框中删除整行

例如:

'the cat likes mice',
'the dog likes the cat',
'dog'
返回

'the cat likes mice',
'the dog likes the cat'

使用
pd.Series.str.contains
方法查找空格如何:

df = pd.DataFrame({'items': ['the cat likes mice',
                             'the dog likes the cat',
                             'dog']})

df = df[df['items'].str.contains(' ')]