0

I need to extract the browser name from a list of user_agents, which is stored as a column in a dataframe.

I want to use the Python library user_agents (https://pypi.org/project/user-agents/), but I can't figure out how to apply the command user_agent.browser.family on my dataframe columns.

So if df_user_agent['context_user_agent'] is the column with the user_agents, and I want to populate df_user_agent['browser'] with the outputs of user_agent.browser.family, what code should I use? Everything I've tried results in errors.

0 Answers0