E:\ana\envs\dl\python.exe E:\pythonProject\ADMM\wiene1.py Traceback (most recent call last): File "E:\pythonProject\A

动态 未结 0 86
小小草
小小草 LV1 2023年9月23日 23:40 发表
The error message indicates that the 'numpy.ndarray' object does not have the attribute 'corrwith'. This is because the 'data' variable passed to the 'pearson_fusion' function is a numpy array, but the 'corrwith' method is a pandas method. To fix this error, you can convert the numpy array to a pandas dataframe before calling the 'corrwith' method. You can use the following code to convert the numpy array to a pandas dataframe: ```python import pandas as pd data = pd.DataFrame(data) ``` Then, you can pass the 'data' dataframe to the 'pearson_fusion' function: ```python composite_index = pearson_fusion(data, weights) ```
收藏(0)  分享
相关标签: 智能问答
问题没解决?让AI助手帮你作答 AI助手
0个回复
  • 消灭零回复