【发布时间】:2020-07-24 05:48:46
【问题描述】:
我在容器 A 中有以压缩格式存在的数据,我需要使用 Python 脚本对其进行转换,并尝试将其安排在 Azure 中进行,但是在将输出写入新的存储容器(容器 B)时,它只是输出一个带有文件名而不是数据的csv。
我完全按照微软网站上给出的教程进行操作,但我无法让它工作——我错过了什么?
https://docs.microsoft.com/en-us/azure/batch/tutorial-run-python-batch-azure-data-factory
file_n='iris.csv'
# Load iris dataset from the task node
df = pd.read_csv(file_n)
# Subset records
df = df[df['Species'] == "setosa"]
# Save the subset of the iris dataframe locally in task node
df.to_csv("iris_setosa.csv", index = False, encoding="utf-8")
# Upload iris dataset
blobService.create_blob_from_text(containerName, "iris_setosa.csv", "iris_setosa.csv")
具体来说,最后一行似乎只是为我提供了一个名为“iris_setosa.csv”的 csv 输出,其中单元格 A1 中的内容为“iris_setosa.csv”,而不是它读取的实际数据。
【问题讨论】:
标签: python azure azure-data-factory