知识卡片

操作参考卡 · 6262.b

批量资料要按身份对回结果

理解等级:中级

每批最多处理指定数量的标识,结果按返回对象的ID或昵称建字典,而不是假定与请求位置一一对应。还应处理请求失败返回None、账号缺失或昵称改变,并记录哪些请求标识没有匹配结果;一批返回成功不证明整批身份都存在或可见。字典键选择也决定同一用户的稳定识别方式。

这张卡片看不懂?

已有反馈 · 0 条

    还没有人提交反馈。

    在整书笔记中的位置

    原书出处 · 1 处

    • · 查看原书依据

      items_to_info = {} items = screen_names or user_ids while len(items) >0: # Process 100 items at a time per the API specifications for /users/lookup. # See https://dev.twitter.com/d

    参考来源

    - 位置:《社交网站的数据挖掘与分析(原书第2版)》第9章《9.17.3 讨论》(spine143;extracted/OReilly精品图书系列共21册(《Javascript权威指南》、《机器学习:实用案例解析》、《编写可读代码的艺术》、《算法精解》等)/_epub-src/text/part0132.html;u205-ch09-025)。 - 结论依据:原文在“items_to_info”附近的定义、例子或代码支撑本卡核心说明:每批最多处理指定数量的标识,结果按返回对象的ID或昵称建字典,而不是假定与请求位置一一对应。边界按已读前提解释;示例未执行。 - 原始内容:items_to_info = {} items = screen_names or user_ids while len(items) >0: # Process 100 items at a time per the API specifications for /users/lookup. # See https://dev.twitter.com/d