-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathNYC_restaurants.py
More file actions
49 lines (40 loc) · 1.3 KB
/
NYC_restaurants.py
File metadata and controls
49 lines (40 loc) · 1.3 KB
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
"""
NYC restaurant inspections and ratings
NYU Open Data
https://nycopendata.socrata.com/Health/DOHMH-New-York-City-Restaurant-Inspection-Results/xx67-kt59
Variable names
CAMIS unique identifier for the entity (restaurant)
DBA business name (doing business as)
BORO 1 = MANHATTAN, 2 = BRONX, 3 = BROOKLYN, 4 = QUEENS, 5 = STATEN IS
BUILDING building number
STREET street name
ZIPCODE
PHONE
CUISINE
INSPECTION DATE
ACTION No violations, re-opened, re-closed, closed, missing = no action
VIOLATION CODE
VIOLATION DESCRIPTION
CRITICAL FLAG
SCORE
GRADE A, B, C, Z = Grade Pending, P=Grade Pending on re-opening
GRADE DATE
RECORD DATE Date data was extracted
From: https://nycopendata.socrata.com/api/views/xx67-kt59/files/cWGKTm3caip6-I-6ZXJ6GeXSw9A_VieTzbBJhE41Mpc?download=true&filename=Restaurant%20Inspection%20Open%20Data%20Dictionary%20082214.xlsx
Repository of materials (including this file):
* https://github.com/NYUDataBootcamp/Materials
Written by Dave Backus, January 2016
Created with Python 3.5
"""
import pandas as pd
# read data from file
file = 'nyc_restaurant_inspections.csv'
dir = '../csv/'
df = pd.read_csv(dir+file)
df.shape
#%%
# read data from NYC repo
url = 'https://nycopendata.socrata.com/api/views/xx67-kt59/rows.csv'
dfweb = pd.read_csv(url, nrows=20)
dfweb.shape
#%%