'Extracting last occurrence of a certain string from each row in a pandas series
from each row i want to extract the last occurrence of the word "user" + the number that follow right after it from a pandas series. everything else can be discarded. how would you perform this action? thanks!!!
here's an example of the series :
0 1 - Unassigned, 2 - User 397335
1 1 - Unassigned, 2 - User 525767, 3 - Unassigned
2 1 - Unassigned
3 1 - Unassigned
4 1 - Unassigned
...
163678 1 - Unassigned
163679 1 - Unassigned, 2 - User 347991, 3 - Unassigned
163680 1 - Unassigned
163681 1 - Unassigned
163682 1 - Unassigned, 2 - User 663455, 3 - Unassigned
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
