-2
ではありません、私は2つの機能の下に持っている:以下引数は 'NoneType' 反復可能なパンダ
#To update the label1 if word is present with is_name
def update(data,word_lists, is_name):
for wlist in word_lists:
if check_keywords(data, wlist):
return is_name
return ''
#To check if Words are present in my Short_description field.
def check_keywords(data, words):
cnt=0
for word in words:
if word in data:
cnt+=1
return cnt==len(words)
私のデータフォーマットである:
SHORT_DESCRIPTION、LABEL1
これらは、私のデータACE_2017にある列。 iは以下
は私のupdateコマンドでLABEL1 SHORT_DESCRIPTIONのキーワードと更新を確認する必要があります。#To check if "access request" or "request Access" is present in Short_description then it should update label1 with 'Access request'
ACE_2017.ix[ACE_2017['label1']=='','label1'] = ACE_2017[ACE_2017['label1']==''].Short_description.map(lambda x: update(x,[['access request','request Access']],'Access request'))
が、私は上記のコマンドを実行したときには、タイプの
引数を言う 'NoneType'反復可能ではありません
どうすればこの問題を解決できますか?
私は答えを書いたが、あなたも何をしようとしているかを知るのに役立つだろう – snapcrack
はデータとその目的で私の質問を更新した – toofrellik