Top search topics

MediumGooglestr.splitstr[0]value_counts· 20 XP

A quick way to group search queries is by their first word: "movie times" and "movie times tonight" both start with "movie".

From searches.csv, store the 5 most common first words of query, with columns word and searches, most common first.

Expected answer

Store your answer in result.

  • Exactly 5 rows, in order

Hints, the later steps and the answer come with Pro.

import pandas as pd

searches = pd.read_csv("searches.csv")
result = ...