Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/google-cloud-platform/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 在Google云库中操作时间序列数据_Python_Google Cloud Platform_Stackdriver_Google Cloud Python - Fatal编程技术网

Python 在Google云库中操作时间序列数据

Python 在Google云库中操作时间序列数据,python,google-cloud-platform,stackdriver,google-cloud-python,Python,Google Cloud Platform,Stackdriver,Google Cloud Python,我试图使用Google Cloud Python库从自定义Stackdriver度量中获取数据,但除了将其作为数据帧返回外,我无法获取所需的值 例如查询,它看起来像: query = client.query(metric_type, minutes=5) 当使用pandas时,返回如下内容: resource_type l7_lb_rule project_id

我试图使用Google Cloud Python库从自定义Stackdriver度量中获取数据,但除了将其作为数据帧返回外,我无法获取所需的值

例如查询,它看起来像:

query = client.query(metric_type, minutes=5)
当使用pandas时,返回如下内容:

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()
我如何筛选它,以便它显示我需要的数据

或者可能我不应该将其显示为数据帧,我只是不知道如何使用此库获取此数据


提前感谢

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

如果您只想查看数据,应该使用云控制台,因为它有一些很好的数据过滤方法。如果您正在对日志进行处理,我建议使用接收器将它们写入bigquery,然后查询并将数据从bigquery加载到数据帧中。