Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/tensorflow/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Numpy 从FancyComputer导入KNN:AttributeError:&x27;KNN和x27;对象没有属性';fit#u变换';_Numpy_Tensorflow_Python 3.8_Fancyimpute - Fatal编程技术网

Numpy 从FancyComputer导入KNN:AttributeError:&x27;KNN和x27;对象没有属性';fit#u变换';

Numpy 从FancyComputer导入KNN:AttributeError:&x27;KNN和x27;对象没有属性';fit#u变换';,numpy,tensorflow,python-3.8,fancyimpute,Numpy,Tensorflow,Python 3.8,Fancyimpute,python新手,这是我的第一个问题 系统信息: Windows7,Python3.8.9,还没有使用virtualenv 我想在我的数据帧(null\u dataframe\u常量)中使用fancyicomputer模块的插补技术 尝试使用FancyComputer模块需要tensorflow以及numpy 1.20.0或最新版本。 但是tensorflow 2.4.1(当前最新版本)需要numpy 1.19.2或以前的版本 当使用numpy 1.19.2并导入FancyComputer时,它

python新手,这是我的第一个问题

系统信息: Windows7,Python3.8.9,还没有使用virtualenv

我想在我的数据帧(null\u dataframe\u常量)中使用
fancyicomputer
模块的插补技术

尝试使用FancyComputer模块需要tensorflow以及numpy 1.20.0或最新版本。 但是tensorflow 2.4.1(当前最新版本)需要numpy 1.19.2或以前的版本

当使用numpy 1.19.2并导入FancyComputer时,它会抛出

:ImportError: numpy.core.multiarray failed to import"
使用numpy 1.20.2时,FancyComputer似乎可以工作,但运行下面的脚本会抛出错误


    from fancyimpute import KNN
    knn_imputer = KNN()
    null_dataframe_constant.iloc[:, :] = knn_imputer.fit_transform(null_dataframe_constant)

有什么想法吗

我已安装以下模块版本:

pylint==2.6.0
pyparsing==2.4.7
pyrsistent==0.16.0
python-dateutil==2.8.1
python-pptx==0.6.18
pytz==2020.1
pywin32==227
pywinpty==0.5.7
PyYAML==5.4.1
pyzmq==19.0.1
qtconsole==4.7.4
QtPy==1.9.0
requests==2.23.0
requests-oauthlib==1.3.0
retrying==1.3.3
rsa==4.7.2
scikit-learn==0.24.1
scipy==1.6.2
scs==2.1.3
seaborn==0.11.0
Send2Trash==1.5.0
six==1.15.0
sklearn==0.0
sortedcontainers==2.1.0
soupsieve==2.0.1
SpeechRecognition==3.8.1
spotipy==2.12.0
squarify==0.4.3
statsmodels==0.12.1
tensorboard==2.4.1
tensorboard-plugin-wit==1.8.0
tensorflow==2.4.1
tensorflow-estimator==2.4.0
termcolor==1.1.0
terminado==0.8.3
testpath==0.4.4
textract==1.6.3
Theano==1.0.5
threadpoolctl==2.1.0
toml==0.10.2
tornado==6.0.4
traitlets==4.3.3
typing-extensions==3.7.4.3
tzlocal==1.5.1
urllib3==1.25.9
wcwidth==0.1.9
webencodings==0.5.1
Werkzeug==1.0.1
widgetsnbextension==3.5.1
wrapt==1.12.1
xlrd==1.2.0
XlsxWriter==1.2.8

经过大量的搜索,我试了一些好玩的东西。 我尝试使用complete()而不是fit_transform()方法。 它工作得很好,尽管我认为我使用的是需要fit.transform()的新模块版本

pylint==2.6.0
pyparsing==2.4.7
pyrsistent==0.16.0
python-dateutil==2.8.1
python-pptx==0.6.18
pytz==2020.1
pywin32==227
pywinpty==0.5.7
PyYAML==5.4.1
pyzmq==19.0.1
qtconsole==4.7.4
QtPy==1.9.0
requests==2.23.0
requests-oauthlib==1.3.0
retrying==1.3.3
rsa==4.7.2
scikit-learn==0.24.1
scipy==1.6.2
scs==2.1.3
seaborn==0.11.0
Send2Trash==1.5.0
six==1.15.0
sklearn==0.0
sortedcontainers==2.1.0
soupsieve==2.0.1
SpeechRecognition==3.8.1
spotipy==2.12.0
squarify==0.4.3
statsmodels==0.12.1
tensorboard==2.4.1
tensorboard-plugin-wit==1.8.0
tensorflow==2.4.1
tensorflow-estimator==2.4.0
termcolor==1.1.0
terminado==0.8.3
testpath==0.4.4
textract==1.6.3
Theano==1.0.5
threadpoolctl==2.1.0
toml==0.10.2
tornado==6.0.4
traitlets==4.3.3
typing-extensions==3.7.4.3
tzlocal==1.5.1
urllib3==1.25.9
wcwidth==0.1.9
webencodings==0.5.1
Werkzeug==1.0.1
widgetsnbextension==3.5.1
wrapt==1.12.1
xlrd==1.2.0
XlsxWriter==1.2.8
from fancyimpute import KNN
knn_imputer = KNN()
null_dataframe_constant.iloc[:, :] = knn_imputer.complete(null_dataframe_constant)