How do I split the values of a column based on conditions in Pandas? I want to get the column B to be transformed to the first split before the point(.) if the value in A is smaller than 5 For example, I have the following table:
| A | B |
|---|---|
| 2 | ABC.DEF |
| 2 | ABC.DEF |
| 8 | ABC.DEF |
| 8 | ABC.DEF |
It should change to
| A | B |
|---|---|
| 2 | ABC |
| 2 | ABC |
| 8 | ABC.DEF |
| 8 | ABC.DEF |