Advanced Regular Expressions

I ran this exact code in my jupyter notebook and it showed me attribute error as you can see in the screenshot. How do i fix this. I browsed about the error on stack overflow but the information i got didn’t help

In latest pandas version Series.str.extract will return a DataFrame, if you want it to return a series set expand=False

1 Like

Thank You. The solution you provided worked