Skip to Content
Python数据处理
book

Python数据处理

by Jacqueline Kazil, Katharine Jarmul
July 2017
Intermediate to advanced
398 pages
11h 54m
Chinese
Posts & Telecom Press
Content preview from Python数据处理
288
13
例,所以一定要评估你想要投入在这之上的努力程度。
API
通常会对所有的用户有频率控制,因为这样更易于管理。
Twitter
API
曾经也使用这
种方式;然而,随着流式
API
的出现,用法发生了改变。
Twitter
的流式
API
提供了数据
的常量流,而
REST API
限制了每
15
分钟你可以发出请求的数量。为了帮助开发者理解频
率限制,
Twitter
发布了一张图表(
https://dev.twitter.com/rest/public/rate-limits
)。
在练习中,我们会使用名叫获取搜索
/
推文(
GET search/tweets
)的
API
。这个接口返回
包含特定搜索语素的推文。如果你查看文档
https://dev.twitter.com/rest/reference/get/search/
tweets
),会发现
API
返回
JSON
格式的数据,频率限制在每
15
分钟
180
次或
450
次,取
决于你是以用户还是应用的身份请求
API
保存来自
API
资源的数据文件时,你可以保存很多文件,或者将数据写入一
个文件。正如在第
6
章学到的,你也可以保存推文数据到数据库。无论你用
什么方式来保存数据,确保定期保存数据,不丢失任何已经请求的数据。
在第
3
章,我们处理了一个
JSON
文件。如果在每
15
分钟之间最大化
API
使用频率,可
以收集
180
JSON
文件。如果你碰到了频率限制问题,需要优化对
Twitter
或者其他
API
的请求,请阅读
Twitter
的“
API
频率限制”(
https://dev.twitter.com/rest/public/rate-limiting ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

数据科学中的实用统计学(第2版)

数据科学中的实用统计学(第2版)

Peter Bruce, Andrew Bruce, Peter Gedeck
Java持续交付

Java持续交付

Daniel Bryant, Abraham Marín-Pérez
解密金融数据

解密金融数据

Justin Pauley

Publisher Resources

ISBN: 9787115459190