I have a dataframe containing urls which can has to be validated and obtain the resultant valid as list. The module used for validation of url is validators module.
Dataframe is like
pd.DataFrame({'url':['https://quotes.toscrape.com/','https://www.nashvillesymphony.org/','www.google.com']})
Output Required
['https://quotes.toscrape.com/','https://www.nashvillesymphony.org/']
Tried data.loc[lambda data: validators.url(data.url) == True] but getting an error TypeError: expected string or bytes-like object
>Solution :
You can do that with the following
results = [x for x in df["url"].values if validators.url(x) == True]