Skip to content

Instantly share code, notes, and snippets.

@ayhanfuat
ayhanfuat / europython_schedule.py
Last active July 28, 2021 15:36
Scrapes the data for EuroPython talks and writes to a CSV file to upload to a calendar
from pandas import DataFrame
from bs4 import BeautifulSoup
import requests
from calendar import month_abbr
import datetime
base = 'https://ep2021.europython.eu'
sessions_url = f'{base}/events/sessions/'
resp = requests.get(sessions_url)
soup = BeautifulSoup(resp.text, 'html.parser')

This is an explanation for the issue Erwin Kalvelagen mentioned in his blog post.

When you add an arbitrary object to a numpy array, numpy tries to add that object to every element of the array which is known as broadcasting.

Here, for example, when you add a pulp.LpVariable to a numpy array, it is added to every element of the array:

In [36]: arr = np.array([1, 2, 3])

In [37]: x = pulp.LpVariable('x')