繁体   English   中英

如何使用MS Azureml将文件保存到目录中?

[英]how to save file into a directory by using MS azureml?

我正在通过这篇文章了解MS Azureml

import azureml.dataprep as dprep
from IPython.display import display
dataset_root = "https://dprepdata.blob.core.windows.net/demo"

green_path = "/".join([dataset_root, "green-small/*"])
yellow_path = "/".join([dataset_root, "yellow-small/*"])

green_df_raw = dprep.read_csv(path=green_path, header=dprep.PromoteHeadersMode.GROUPED)
# auto_read_file automatically identifies and parses the file type, which is useful when you don't know the file type.
yellow_df_raw = dprep.auto_read_file(path=yellow_path)

display(green_df_raw.head(5))
display(yellow_df_raw.head(5))

到目前为止,一切顺利。

当我尝试将数据框保存到目录时,这在另一篇文章中提到。

write_t = green_df_raw.write_to_csv(directory_path=dprep.LocalFileOutput('./green.csv'))
write_t.run_local()

出现错误

1中的ExecutionError误差回溯(最近一次呼叫最近)1个write_t = green_df_raw.write_to_csv(directory_path = dprep.LocalFileOutput('./ green.csv'))----> 2 write_t.run_local()

〜/ anaconda3_501 / lib / python3.6 / site-packages / azureml / dataprep / api / dataflow.py in run_local(self)357 self._engine_api.execute_anonymous_blocks(ExecuteAnonymousBlocksMessageArguments(358 blocks = steps_to_block_datas(self._steps),->第359章(361)

包装中的〜/ anaconda3_501 / lib / python3.6 / site-packages / azureml / dataprep / api / _aml_helper.py(op_code,message)如果len(已更改)> 0,则为36:37 engine_api_func()。update_environment_variable(已更改)- -> 38返回send_message_func(op_code,message)39 40返回包装器

〜/ anaconda3_501 / lib / python3.6 / site-packages / azureml / dataprep / api / engineapi / api.py in execute_anonymous_blocks(self,message_args)54 @update_aml_env_vars(get_engine_api)55 def execute_anonymous_blocks(self,message_argsArch:类型定义初始)Execute。 ->无:---> 56响应= self._engine.send_message('Engine.ExecuteActivity',message_args)57返回响应58

〜/ anaconda3_501 / lib / python3.6 / site-packages / azureml / dataprep / api / engineapi / engine.py in send_message(self,op_code,message)61 response = self._read_response()62如果响应中出现“错误”: ---> 63 raise_engine_error(response ['error'])64 elif response.get('id')== message_id:65返回response ['result']

〜/ anaconda3_501 / lib / python3.6 / site-packages / azureml / dataprep / api / errorhandlers.py in raise_engine_error(error_response)68 error_code = error_response ['errorCode'] 69如果error_code中的'ActivityExecutionFailed':--- 70在错误代码中引发ExecutionError(error_response)71 elif'UnableToPreviewDataSource':72在预览数据中引发PreviewDataSourceError(error_response)

ExecutionError:创建具有指定路径的文件时发生I / O错误。

此错误在https://notebooks.azure.com上可100%重现。

您可以使用另一种方法final_df.save(file_path) 是我的代码。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM