0

I have a Dataframe with a column called "Number" The values in the column look like this: 1.2.1 2.3.1 2.4.1 Now I want to filter based on the value in this column. But I just to check the first Number: Thats means that 2.3.1 and 2.4.1 are the same for me (2) So I just to filter like "Number" == 2 How do I convert them?

JDog
  • 29
  • 3

1 Answers1

0

You can use:

df[df['Number'].str.startswith('2.')]
zipa
  • 27,316
  • 6
  • 40
  • 58