NYC Subway Turnstile Data

栏目: IT技术 · 发布时间: 5年前

内容简介:Download NYC subway turnstile data files fromHastily put together in March 2020, structured as a Rails app but the only functionality is to download files and load them into a Postgres table calledThe repo does not currently support the MTA file formats fo

NYC Subway Turnstile Data

Download NYC subway turnstile data files from the MTA's website and load them into a database

Hastily put together in March 2020, structured as a Rails app but the only functionality is to download files and load them into a Postgres table called turnstile_observations

The repo does not currently support the MTA file formats for the time period 5/5/2010–10/11/2014

Initialize database

bundle exec rake db:setup

Example usage

From the Rails console, import a single file:

TurnstileObservation.import_turnstile_observations(date: "2020-03-21".to_date)

Import all files:

TurnstileObservation.
  all_available_dates.
  select { |d| d >= TurnstileObservation::FIRST_DATE_WITH_NEW_FORMAT }.
  each { |d| TurnstileObservation.import_turnstile_observations(date: d) }

After importing files, you have to run another query to set the net_entries and net_exits colums:

TurnstileObservation.set_net_entries_and_net_exits

以上所述就是小编给大家介绍的《NYC Subway Turnstile Data》,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对 码农网 的支持!

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

怪诞行为学2

怪诞行为学2

[美]丹·艾瑞里 / 赵德亮 / 中信出版社 / 2010-1-9 / 42.00元

《怪诞行为学2:非理性的积极力量》编辑推荐:尝试用“非理性”的决策方式,彻底颠覆工作和生活中的“逻辑”,你将获得意想不到的成就感与幸福感!畅销书《怪诞行为学》作者卷土重来,掀起新一轮“非理性”狂潮。 《写给中国人的经济学》作者王福重、著名行为经济学家董志勇倾情作序。 诺贝尔经济学奖得主阿克尔洛夫、《免费》作者安德森高度评价。 《纽约时报》《哈佛商业评论》《波士顿环球报》等全球顶级......一起来看看 《怪诞行为学2》 这本书的介绍吧!

Base64 编码/解码
Base64 编码/解码

Base64 编码/解码

XML 在线格式化
XML 在线格式化

在线 XML 格式化压缩工具

HEX HSV 转换工具
HEX HSV 转换工具

HEX HSV 互换工具