I have a dataframe now of a list of urls and i'm trying to find the top 10 urls based on freq. This is what I have,
+------------+ |urls | +------------+ |google.com | |linkedin.com| |yahoo.com | |google.com | |yahoo.com | +------------+I tried to add a freq column but I cannot seem to get it. I tried count(df,"url") but it only gives me the freq without the urls like this,
+----+ |freq| +----+ |2 | |1 | |2 | |2 | |2 | +----+
can I know how can I get a dataframe like this,
+---------------+------------+ |urls | freq | +---------------+------------+ |google.com | 2 | |linkedin.com | 1 | |yahoo.com | 2 | |google.com | 2 | |yahoo.com | 2 | +---------------+------------+
also I need to sort it by top 10?