Skip to content
Advertisement

How to use urlparse in python pandas

Here is my code for getting domain name from string:

JavaScript

I don’t know how to use this method in pandas. Here is my pandas dataframe:

JavaScript

I tried this code but didn’t work:

JavaScript

getting this error:

JavaScript

Advertisement

Answer

A simple solution would be to use Series.apply

JavaScript
Advertisement