[英]How to save file in database and a directory using flask SQLAlchemy?
[英]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.