Skip to content

Instantly share code, notes, and snippets.

View time_1.py
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
###
View brains.py
# 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]
View accident_col.py
# 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']
View average_rating.py
art_movement = df.groupby(['art_movement']).mean()
art_movement.average_rating