I want to find all index values that contain the string ' (target)'.
Example:
index = pd.Index(['TIC7201-PV (target)', 'TIC7202-PV', 'TIC7203-PV'])
print(index.str.contains(' (target)'))
What I get:
[False False False]
What I expected:
[ True False False]
For comparison:
print(index.str.contains('(target)'))
print(index.str.endswith(' (target)'))
produces:
[ True False False]
[ True False False]