【发布时间】:2020-02-07 14:41:07
【问题描述】:
This is my code for the music recommendatin system.
这是错误,。
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-19-b58e57e00aac> in <module>
2 print (query_index)
3
----> 4 distances, indices = model_knn.kneighbors(wide_artist_data.iloc[query_index, :].reshape(1, -1), n_neighbors = 6)
5
6 for i in range(0, len(distances.flatten())):
~\AppData\Local\Continuum\anaconda3\lib\site-packages\pandas\core\generic.py in __getattr__(self, name)
5272 if self._info_axis._can_hold_identifiers_and_holds_name(name):
5273 return self[name]
-> 5274 return object.__getattribute__(self, name)
5275
5276 def __setattr__(self, name: str, value) -> None:
AttributeError: 'Series' object has no attribute 'reshape'
【问题讨论】:
-
嗨,Devilsubarna!欢迎来到 StackOverflow!下次,请复制并粘贴您的代码,而不是发送链接(这有助于我们为您测试)
标签: python attributeerror recommendation-engine