Linked Questions

Popular Questions

Reverse pandas string / reverse extract pandas DF

Asked by At

Good day,

I got files with path in column thus:


I wish to extract the pattern _\d from this like this:

'C:/some_1_path/'| '_1' 
'C:/some_1_path/'| '_2'

Since the _1 happens to be in path .str.extract() picks that one. extractall will work , but requires extra steps.

How would one do .str.extract(pattern) in reverse order? I could reverse the string but extra steps and all that.

Related Questions