This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# we define the list of stopwords in english | |
stopwords = nltk.corpus.stopwords.words('english') | |
# we compute the phrases present in each review | |
phrases_stream = [transform_sentence_in_phrases(review) for review in reviews] | |
# we visualize the elements present in the first review (index 0 of the list) | |
phrases_stream[0] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time | |
import requests | |
items_to_scrape = ['https://en.wikipedia.org/wiki/Madrid', 'https://en.wikipedia.org/wiki/Munich', 'https://en.wikipedia.org/wiki/Valencia'] | |
for item in items_to_scrape: | |
response = requests.get(item) | |
### | |
### your code | |
### |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# check brains available | |
env.brain_names | |
# ['BananaBrain'] | |
# select first brain | |
brain_name = env.brain_names[0] | |
# set it as the brain we will be controlling from python | |
brain = env.brains[brain_name] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# list with columns names | |
list(df.columns) | |
# ['Id','District Name','Neighborhood Name','Street','Weekday','Month','Day','Hour','Part of the day','Mild injuries','Serious injuries','Victims','Vehicles involved','Longitude','Latitude'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
art_movement = df.groupby(['art_movement']).mean() | |
art_movement.average_rating |