【发布时间】:2020-07-09 10:14:43
【问题描述】:
我正在尝试将 DataFrame 从 Azure 函数写入 outputBlob。我无法确定要使用哪个 io 流。
我的函数如下所示:
import io
import xlrd
import pandas as pd
def main(myblob: func.InputStream, outputBlob: func.Out[func.InputStream]):
logging.info(f"Python blob trigger function processed blob \n"
f"Name: {myblob.name}\n"
f"Blob Size: {myblob.length} bytes")
input_file = xlrd.open_workbook(file_contents = myblob.read())
df = pd.read_excel(input_file)
if not df.empty:
output = io.BytesIO()
outputBlob.set(runway1.to_excel(output))
我们如何将 DataFrame 保存到 Azure 函数可识别的流中以将 excel 写入存储容器?
【问题讨论】:
-
你能告诉我你的错误吗?
标签: python azure azure-functions azure-blob-storage