Skip to content

Instantly share code, notes, and snippets.

[
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "@channel Happy {}! :wave:"
}
},
{
"type": "section",
[{"type": "section", "text": {"type": "mrkdwn", "text": "Happy {}! :wave:"}}, {"type": "section", "text": {"type": "mrkdwn", "text": "Here is your <{}|warmup> for today."}}]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@joelsewhere
joelsewhere / nyc_bedbugs.py
Created October 4, 2023 18:22
Visualize Bedbug Reports by Year and Month
from requests import get
from io import StringIO
import pandas as pd
import matplotlib.pyplot as plt
url = 'https://data.cityofnewyork.us/api/views/wz6d-d3jb/rows.csv?accessType=DOWNLOAD'
response = get(url)
io = StringIO(response.content.decode('utf-8'))
df = pd.read_csv(io)
df = df.assign(filing_date=pd.to_datetime(df['Filing Date']))
from airflow import DAG
from datetime import datetime, timedelta
from airflow.providers.postgres.operators.postgres import PostgresOperator
default_args = {
'owner': 'airflow',
'retries': 1,
'retry_delay': timedelta(minutes=5),
'start_date': datetime(2024, 1, 1),
}