python - matching a substring in a dateframe column -


i want match id column in dataframe if name contain string 'test_'. there simple way boolean vector df.id == 'something' df.id contains 'test_'.

iiuc following should work:

df.loc[df['id'].str.contains('test_'), 'id'] 

this return id's contain partial string

if want boolean array against rows:

df['id'].str.contains('test_') 

Comments

Popular posts from this blog

gridview - Yii2 DataPorivider $totalSum for a column -

java - Suppress Jboss version details from HTTP error response -

Sass watch command compiles .scss files before full sftp upload -