如何将笨拙的表数据写入PANDAS数据框架?
我正在尝试将GCP BigTable - 表读取到pandas数据帧,目前,我用来从BigTable获取行的函数是read_rows()< /code>,返回PartialRowData。
代码:
from google.cloud import bigtable
client = bigtable.Client(admin=True)
instance = client.instance(bigTable_parms['instance_id'])
table = instance.table('s2')
row_data = table.read_rows() # table.yield_rows()
for i in row_data:
print(type(i))
输出:
<类“google.cloud.bigtable.row_data.PartialRowData”>
查询:
我们如何从 PartialRowData
对象读取值?
I am trying to read a GCP BigTable - table to a pandas dataframe, and currently, the function I am using to fetch rows from BigTable is read_rows()
, which returns PartialRowData.
Code:
from google.cloud import bigtable
client = bigtable.Client(admin=True)
instance = client.instance(bigTable_parms['instance_id'])
table = instance.table('s2')
row_data = table.read_rows() # table.yield_rows()
for i in row_data:
print(type(i))
Output:
<class 'google.cloud.bigtable.row_data.PartialRowData'>
Query:
How do we read the values from PartialRowData
obj?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
本文档中有一个有关如何调用
read_rows
的示例:https://googleapis.dev/ python/bigtable/latest/table.html#google.cloud.bigtable.table.Table.read_rows
There's an example on how to call
read_rows
in this documentation:https://googleapis.dev/python/bigtable/latest/table.html#google.cloud.bigtable.table.Table.read_rows