I know there are a lot of questions (and answers) about this, but I cannot solve this particular cases using the recommended solutions:
1)
df=df.dropna(how='any')
I changed it to
df.loc[:,:]=df.dropna(how='any')
But if I do it, the dropna does not work.
Should I use for this case
df.dropna(how='any', inplace=True)
to avoid the reassignment?
2) & 3)
column_name='my_name'
df[column_name]=df.apply(lambda row: nltk.word_tokenize(row[column_names]), axis=1)
df[column_name]=df.apply(lambda row: [w for w in row[column_name]if not w in stop_words],axis=1)
I changed the two df[column_name] of the left side by
df.loc[:,column_name]
But I get an error with the axis parameter
Which is the best solution for these cases?