TypeError:类型为'numpy.float64'的对象在找到均值时没有len()

时间:2018-02-21 12:40:30

标签: python mean azure-machine-learning-studio

我正在使用Python脚本在Azure ML Studio中进行简单的操作。

import numpy as np

dt_mean = np.mean(dt.iloc[:,0].values)

但是它会抛出错误

[Critical]     Error: 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 51, in DataFrameToRFile
    attributes = XDRBridge.DataFrameToRObject(dataframe)
  File "C:\server\XDRReader\xdrbridge.py", line 40, in DataFrameToRObject
    if (len(dataframe) == 1 and type(dataframe[0]) is pd.DataFrame):
TypeError: object of type 'numpy.float64' has no len()
Process returned with non-zero exit code 1

这个在Spyder中完美无缺。但它不适用于Azure ML Python脚本。

0 个答案:

没有答案