Skip to content
Advertisement

Python extract number between two special character in dataframe

I try to extract the number between the $ and white space in a column, then use the number to create a new column

JavaScript

I look at many solutions on stackoverflow about Regular expression. it’s hard to understand

my code doesn’t work

JavaScript

are there any other solutions besides RegEx, if not, how to fix my code?

Advertisement

Answer

Escape the $:

JavaScript

Prints:

JavaScript
User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement