I have a pandas DataFrame, which has a column named is_retweeted
. The values in this column are either Yes
or No
. If, the value is 'Yes', I want to go ahead performing X type sentiment analysis (the code for which I have). Else-if value is No
, I want to go ahead performing Y type sentiment analysis (again, the code for which I have)
But, I am unable to check for this condition. I get the same error seen here. No solution here is helping for my usecase.
Based on what is suggested here if I do:
s = 'Yes' in tweet_df.is_retweeted print(s)
I get False
as output.
This is what the dataframe looks like (for ease of representation I havent displayed other columns here):
tweet_dt is_retweeted
2020-09-01 No
2020-09-01 No
2020-09-01 Yes
I want to perform below sorta operation based on the value in 'is_retweeted' column:
retweets_nerlst = []
while tweet_df['is_retweeted'] == 'Yes':
for index, row in tqdm(tweet_df.iterrows(), total=tweet_df.shape[0]):
cleanedTweet = row['tweet'].replace("#", "")
sentence = Sentence(cleanedTweet, use_tokenizer=True)
PS: My codebase can be seen here