![]() On this Sunday morning at 11:27am here is the search activity for the term RAPE in the past 60 minutes. If any part of our starting assumption is correct, the specificity is upsetting. I enter the term RAPE into TRENDS and set it for the past 1 hour and here is the graph. With that in mind, we will go through aggregated Google search queries believing that people who have been sexually assaulted, while they may never tell anyone, are telling Google. We only type in there what is honestly on our minds. Seth points out that while we might lie to ourselves, our significant others, our spouses, and our children, the one place we never lie is the Google search box. This project was inspired by Seth Stephens-Davidowitz’s book EVERYBODY LIES. If there are discrepancies perhaps they will give us an idea of the under reporting. Part 2 will be comparing our data with govt sex crimes data. In Part 1 we gather the daily and hourly search data for various terms that we think are related to RAPE. We will use data from Google TRENDS to try and get an idea of how prevalent sex crimes are. Writer = pd.How many sex assault crimes go unreported? #exports the three dataframes into excel and formats them. (notice how a 50 on the 0-100 scale is actually just the average weekly search volume) Calculate the real weekly search volume for each week of the period by multiplying the 0-100 index for that week by the multiplier for that term.Divide average weekly search volume by 50 to get a multiplier for that particular term.Divide average monthly search volume by 4 to get average weekly search volume.This next block is my favorite in this entire program because it gives us the actual search volumes for each week of the time period just like glory days of Google Trends. Trends.insert(0, "avg monthly volume", volumes_col) #add the search volume column to the trends dataframe #get the list of volumes from the terms that had trends (required because if a term doesn't have a trend it is removed) Like several hours to scrape one channel slow…I digressĪt the end of the code block we call function we just coded up and voilà! We have a dataframe of search trends. ![]() This is slower than some API’s much much faster than other like the Youtube API which is hauntingly slow. The speed of this API is about average and probably take 60 seconds to scrape the trends for 100 terms. We however are more interested in the trend of the individual terms here, so this next function loops through our list of terms from our excel file earlier and runs each through our scrape_google function above and then append this trend data to a pandas dataframe called trends. PyTends, is similar in that it can get trends for a list of up to 5 keywords. When comparing multiple trends together on Google, the 0-100 values are relative to each other. Pytrends.build_payload(term, cat=0, timeframe=' ', geo='US', gprop='') Blank is regular search but you can segment it by ‘youtube’, ‘images’, ‘new’, or even ‘froogle’ for shopping.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |