def categorizeMainUrl(url):
category = "other"
if "/special/" in url:
category = "special"
return category
df["category"] = df["main_URL"].apply(lambda url: categorizeMainUrl(url))
While running this part of the code, I keep the following exception.
"TypeError: argument of type 'float' is not iterable"
How can I select only the section of the dataframe with the float values?
(In this column, I would wait only string as a datatype)