TypeError:“DataFrame”对象是不可调用的错误消息

2024-09-27 04:25:51 发布

您现在位置:Python中文网/ 问答频道 /正文

liste_products = df_cleaned['Description'].unique()

X = pd.DataFrame()
for key, occurence in list_products:
    X.loc[:, key] = list(map(lambda x:int(key.upper() in x), liste_products))

抛出错误

TypeError                                 Traceback (most recent call last)
<ipython-input-181-6d04c94ad6e2> in <module>
       X = pd.DataFrame()
       for key, occurence in list_products:
---->      X.loc[:, key] = list(map(lambda x:int(key.upper() in x), liste_products))

TypeError: 'DataFrame' object is not callable

Tags: lambdakeyinmapdataframeforupperloc

热门问题