나는 아래 Python 스크립트를 가지고있다. 그리고 새로운 Dataframe을 반환하려고합니다. 불행히도, 난 "NotImplementedError :"얻고Python 스크립트에서 Azure ML의 Dataframe을 반환하는 방법
나 파이썬 스크립트
코드에서 푸른 ML에 Dataframe을 반환하는 방법, 알려 주시기 바랍니다 :
def azureml_main(df) :
therm_patterns,therm_missed_patterns = thermostat_phase(df)
th_pat = json.loads(therm_patterns)
missed_th_pat = json.loads(therm_missed_patterns)
light_patterns, light_missed_patterns = light_phase(df)
lt_pat = json.loads(light_patterns)
missed_lt_pat = json.loads(light_missed_patterns)
for j in range (0,len(lt_pat)):
for i in range (0,len(lt_pat[0]['John'])):
th_pat[0]['John'].append(lt_pat[0]['John'][i])
for j in range (0,len(lt_pat)):
for i in range (0,len(lt_pat[0]['Jane'])):
th_pat[0]['Jane'].append(lt_pat[0]['Jane'][i])
for j in range (0,len(lt_pat)):
for i in range (0,len(lt_pat[0]['Jen'])):
th_pat[0]['Jen'].append(lt_pat[0]['Jen'][i])
for j in range (0,len(missed_lt_pat)):
for i in range (0,len(missed_lt_pat[0]['John'])):
missed_th_pat[0]['John'].append(missed_lt_pat[0]['John'][i])
for j in range (0,len(missed_lt_pat)):
for i in range (0,len(missed_lt_pat[0]['Jane'])):
missed_th_pat[0]['Jane'].append(missed_lt_pat[0]['Jane'][i])
for j in range (0,len(missed_lt_pat)):
for i in range (0,len(missed_lt_pat[0]['Jen'])):
missed_th_pat[0]['Jen'].append(missed_lt_pat[0]['Jen'][i])
output = json.dumps(th_pat)
df = pd.DataFrame.from_dict({k: v[0] for k, v in json.loads(output)
[0].items()}, 'index').rename_axis('User').reset_index()
return df
오류 :
Error 0085: The following error occurred during script evaluation, please
view the output log for more information:
---------- Start of error message from Python interpreter ----------
Caught exception while executing function: Traceback (most recent call
last):
File "C:\server\invokepy.py", line 211, in batch
xdrutils.XDRUtils.DataFrameToRFile(outlist[i], outfiles[i], True)
File "C:\server\XDRReader\xdrutils.py", line 54, in DataFrameToRFile
xdrwriter.write_attribute_list(attributes)
File "C:\server\XDRReader\xdrwriter2.py", line 155, in
write_attribute_list
self.write_object(value)
File "C:\server\XDRReader\xdrwriter2.py", line 215, in write_object
write_func(flags, converted, missingIndices)
File "C:\server\XDRReader\xdrwriter2.py", line 185, in write_objects
self.write_object(value)
File "C:\server\XDRReader\xdrwriter2.py", line 200, in write_object
raise NotImplementedError('Python Bridge conversion table not
implemented for type [{0}]'.format(value.getType()))
NotImplementedError: Python Bridge conversion table not implemented
for type [<type 'list'>]
Process returned with non-zero exit code 1
azureml_main()에서 팬더 데이터 프레임을 사용할 때 문제가 있습니다. Microsoft는 2011 년 1 월 18 일에 수정본이 나왔다고 말합니다. 다행히도 문제가 해결 될 수 있기를 바랍니다. – andyabel