Я хочу проверить длину предложения в длинном столбце фрейма данных и вернуть другой фрейм данных len (предложение) * слово замены. Это образец предложений, длины которых я хочу проверить.
"But for his attorney's incompetence",
'should there have been more supervision from the parents while their children were in the kitchen',
"If I didn't have the option of makeup (concealer)",
'if she had foregone insurance and printed off a savings coupon from the website GoodRx',
'provided that his name were Rand Smith, or his father were Ron Paul the car salesman rather than Ron Paul the almost-libertarian presidential candidate',
for ant in range(len(antecedents)):
replace_tag = 'ante' #the replacement word
ant_to_string = ' '.join([str(elem) for elem in antecedents]) #convert to string
get_words = ant_to_string.split(" ") #split string
phrase_tag.append(list((replace_tag,) * len(get_words)))#multiply string for each word in the instance
df = pd.DataFrame(phrase_tag, columns=['labels'])#fill in dataframe
и вместо фрейма данных из 3550 строк я получаю фрейм данных из 49000i sh строк
bound method NDFrame.sample of labels
0 ante
1 ante
2 ante
3 ante
4 ante
... ...
49583 [ante, ante, ante, ante, ante, ante, ante, ant...
49584 [ante, ante, ante, ante, ante, ante, ante, ant...
49585 [ante, ante, ante, ante, ante, ante, ante, ant...
49586 [ante, ante, ante, ante, ante, ante, ante, ant...
49587 [ante, ante, ante, ante, ante, ante, ante, ant...
что я делаю не так?