代码之家  ›  专栏  ›  技术社区  ›  grinferno

在谷歌云库中操作时间序列数据

  •  0
  • grinferno  · 技术社区  · 7 年前

    例如,查询看起来像:

    query = client.query(metric_type, minutes=5)
    

    当使用熊猫时,返回如下内容:

    resource_type                                 l7_lb_rule
    project_id                                    my_id
    backend_name
    backend_zone
    forwarding_rule_name                          foo-http     foo-https
    instance_group_name
    matched_url_path_rule
    target_proxy_name                           foo-target-1 foo-https-060417
    target_proxy_type
    url_map_name                                         foo              foo
    log                                             requests         requests
    2017-06-26 15:43:06.750                               26               25
    

    然而,我不知道如何操作它来获得我需要的值,这些值本质上是http和https请求的数量(我想求和)。

    例如,如果我要使用 iterrows()

    或者,我不应该将其显示为数据帧,我只是不知道如何使用这个库获取这些数据。

    提前感谢

    1 回复  |  直到 7 年前
        1
  •  0
  •   grinferno    7 年前

    我决定完全避免使用数据帧,只需迭代timeseries对象来提取所需的值。