Skip to content

Instantly share code, notes, and snippets.

View hassanshamim's full-sized avatar

Hassan Shamim hassanshamim

  • Philadelphia, PA
View GitHub Profile

So just looking at your code a bit, I can’t run anything because I don’t have the data. An idea I had that might speed up the process:

Instead of your double for loop where you count the number of times each keyword apeears in the query, you could iterate over all the search queries and build a dictionary (or use counter module) to count the number of times each word appears in total.

# i.e.
@hassanshamim
hassanshamim / example.py
Created December 14, 2016 02:20
example gist
print('hello world')
@hassanshamim
hassanshamim / example_cal.py
Last active September 1, 2017 02:28
Cal helper files
print(""" September 2017
Su Mo Tu We Th Fr Sa
1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
""")
@hassanshamim
hassanshamim / capwords.py
Created October 10, 2017 12:48
capwords.py
def capwords(text, sep=None):
return (sep or ' ').join(word.capitalize() for word in text.split())
@hassanshamim
hassanshamim / capwords.py
Created October 10, 2017 12:48
capwords.py
def capwords(text, sep=None):
return (sep or ' ').join(word.capitalize() for word in text.split())