-
Notifications
You must be signed in to change notification settings - Fork 34
/
create_data.py
27 lines (17 loc) · 923 Bytes
/
create_data.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import pandas as pd
import chicago_data
import datetime
# endpoints = {2020: "https://data.cityofchicago.org/resource/qzdf-xmn8",
# 2021: "https://data.cityofchicago.org/resource/dwme-t96c",
# 2022: "https://data.cityofchicago.org/resource/9hwr-2zxp",
# 2023: "https://data.cityofchicago.org/resource/xguy-4ndq",
# 2024: "https://data.cityofchicago.org/resource/dqcy-ctma"}
endpoint = "https://data.cityofchicago.org/resource/ijzp-q8t2"
start = datetime.datetime(2020,1,1,0,0,0)
end = datetime.datetime(2024,4,24,0,0,0)
df = chicago_data.backfill_chicago_data(endpoint = endpoint,
start = start,
end = end,
offset = 24 * 30,
limit = 100000)
df.to_csv("data/chicago_crime_2020-2024.csv", index = False)