Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
import aiohttp
import asyncio
import io
import pandas as pd
lessons = [
# Ed Lesson IDs
token = "" # Ed login token
params = {
'numbers': '0',
'scores': '0',
'students': '1',
'completions': '1',
'strategy': 'best',
'ignore_late': '0',
'late_no_points': '1',
'tz': 'America/Los_Angeles',
async def completion(session, lesson):
async with
data={"_token": token}
) as response:
payload = await response.text()
return (
.iloc[:, 4:]
async def main():
async with aiohttp.ClientSession() as session:
values = await asyncio.gather(*[completion(session, lesson) for lesson in lessons])
return pd.concat(values, axis=1)
loop = asyncio.get_event_loop()
completions = loop.run_until_complete(main())
print((completions >= completions.median()).sum(axis=1).to_csv(index=True, header=False, sep="\t"))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment