Данный файл csv. Я хочу, чтобы в переменной good_words были все слова, которые есть в столбце CleanedText. Но он показывает следующую ошибку:
ValueError: The truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all().
Столбец CleanedText содержит все слова, полученные после удаления стоп-слов с помощью nltk.
good_words = []
if edata3['class']=='good':
good_words = edata3.loc[0: , 'CleanedText']
Блок кода перед ним:
import os
if os.path.isfile(r'/Users/vivekbhadula/study/cleaned_final.db'):
conn = sqlite3.connect(r'/Users/vivekbhadula/study/cleaned_final.db')
final = edata2['CleanedText']
edata3 = edata2.copy()
edata3.append(final)
else:
print('Please run the above cell')
Результат edata3.head ():
**Clothing ID|| Age ||Title || Review_Text|| Rating|| Recommended_IND || Positive_Feedback_Count || Division_Name|| Department_Name ||Class_Name|| class|| CleanedText**
2 1077|| 60 ||Some major design flaws || I had such high hopes for this dress and reall... ||3 ||0 ||0 ||General|| Dresses ||Dresses|| bad high hope dress realli want work initi order p...
3 1049 50 My favorite buy! I love, love, love this jumpsuit. it's fun, fl... 5 1 0 General Petite Bottoms Pants good love love love jumpsuit fun flirti everi time ...
4 847 47 Flattering shirt This shirt is very flattering to all due to th... 5 1 6 General Tops Blouses good shirt flatter due adjust front tie perfect len...
5 1080 49 Not for the very petite I love tracy reese dresses, but this one is no... 2 0 4 General Dresses Dresses bad love traci rees dress one petit feet tall usua...
6 858 39 Cagrcoal shimmer fun I aded this in my basket at hte last mintue to... 5 1 1 General Petite Tops Knits good ade basket hte last mintu see would look like ...