I am new to python and when I am reproducing one code. I am stuck with an error.
text['phrases'] = text['segmanted_text1'].apply(collect_phrases)
total_phrases = text[['airline_id', 'phrases']]
#pick which airline to
phrases = total_phrases[total_phrases['airline_id']==5]
opinion_phrases = process(phrases)
del text, phrases, total_phrases
Here, the airline_id is not a part of the dataframe of text. And, also not defined yet. However, it is to create to link with the phrases.
The error return as index not found for airline_id.
Can anyone please advise me what I am doing wrong here?
thanks.
total_phrases['airline_id'] = text['phrases']. I'm not sure whatairline_idis in this situation though, so you might have to explain it in more detail.total_phrases[xxx]==5return boolean , not valid key