abjer / sds

Social Data Science - a summer school course
https://abjer.github.io/sds
18 stars 34 forks source link

opgave 9.2.3 #7

Closed Jansen93lol closed 6 years ago

Jansen93lol commented 6 years ago

Kan i uddybe opgave 9.2.3? Vi har lidt svært ved at fortolke opgaven?

Vores fortolkning er: Vi har nogen beløb (fra opgave 9.2.2), hvor vi så nu skal fiske sætningerne ud, hvor disse beløb indgår i, for at forstå sammenhængen. Er dette korrekt forstået?

snorreralund commented 6 years ago

So in 9.1-2 you developed a regular expression for matching currencies in a string. Now you should write a function that takes a string as input, and returns True if a currency pattern has been matched, and False if not.

def has_currency(string):
    matches = re.findall(pattern,string)
    if ....:# check if there are any matches and return True
        return True
    else: # else return False
        return False

Then apply this to all reviews using the .apply function.