1

My dataframe looks like this

  1. clients4.google.com
  2. m.facebook.com
  3. static.ak.fbcdn.net
  4. static.ak.fbcdn.net
  5. static.ak.fbcdn.net

I want to select all the rows where the substring fb is available. In pandas dataframe

0

1 Answer 1

5

You can use StringMethods.contains:

>>> df = pd.read_clipboard(header=None)
>>> df[df[0].str.contains('fb')]
                     0
2  static.ak.fbcdn.net
3  static.ak.fbcdn.net
4  static.ak.fbcdn.net
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.