【发布时间】:2019-02-19 21:14:14
【问题描述】:
我正在尝试使用他们的 SODA API 过滤 ny gov 开放数据库。我正在关注有关如何过滤的文档,但它返回一个空数据框。
# noinspection PyUnresolvedReferences
import numpy as np
# noinspection PyUnresolvedReferences
import pandas as pd
# noinspection PyUnresolvedReferences
from sodapy import Socrata
clientNYgov = Socrata('data.ny.gov', None)
这是我试图仅在纽约找到结果的地方。
databaseM = clientNYgov.get('yg7h-zjbf.csv?business_city=NEW+YORK')
dfDatabaseM = pd.DataFrame.from_records(databaseM)
dfDatabaseM.to_csv('Manhattan Agents.csv')
print(dfDatabaseM)
但这里是空输出:
0 1 ... 9 10
0 business_address_1 business_address_2 ... license_number license_type
[1 rows x 11 columns]
Process finished with exit code 0
如果我的过滤方式有问题,请告诉我,不太确定这里出了什么问题。提前非常感谢!
【问题讨论】:
标签: python-3.x socrata soda