我正在Azure机器学习平台/云上运行Python代码,但无法弄清楚如何将结果数据帧保存到Azure Blob存储中的csv文件中。有人可以告诉我该怎么做,或指出我可以在其中了解更多信息的地方吗?
您是否可以尝试使用以下python代码将文件上传到Azure博客:
global service_client
service_client = DataLakeServiceClient(account_url="{}://{}.dfs.core.windows.net".format("https", 'Storage_account_name'), credential='Storage_Account_Key')
#upload file to ADLS Gen 2
file_system_client = service_client.get_file_system_client(file_system="your_container_name")
directory_client = file_system_client.get_directory_client("my-directory")
file_client = directory_client.create_file("uploaded-file.txt")
local_file = open("C:\\Users\\xxxxxxx\\Desktop\\testFile.txt", 'r')
file_contents = local_file.read()
file_client.append_data(data=file_contents, offset=0, length=len(file_contents))
file_client.flush_data(len(file_contents))
有关完整代码的更多详细信息,请访问 此链接
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句