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

时间:2020-05-13 20:15:55

标签: python dataframe

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

0 个答案:

没有答案