-1

I have a pandas dataframe:

enter image description here

It is a large dataframe. How can i filter out all the rows with id "north_south"?

NSD
  • 13
  • 3

1 Answers1

0

The contains function under the str accessor returns the values that contain a given set of characters.

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

Gaston Alex
  • 151
  • 1
  • 6