1

It seems like straight forward thing however could not find appropriate SO answer.

I have a column called title which contain strings. I want to find out rows that starts with letter "CU".

I've tried using df.loc however It's giving me indexError,

Using regex, re.findall(r'^CU', string) returns 'CU' instead of full name ex: 'CU abcd'. How can I get full name that starts with 'CU'?

EDIT: SORRY, I did not notice it was a duplicate question, problem solved by reading duplicate question.

chaikov
  • 495
  • 4
  • 18

1 Answers1

0

You can try:

string.startswith("CU")
Lê Tư Thành
  • 1,063
  • 2
  • 10
  • 19