I have a dataframe filled with several columns. I need to change the values of a column for data normalization like in the following example:
User_id
751730951
751730951
0
163526844
...and so on
I need to replace every value in the column that is not 0 (string) in a into something like "is not empty". I have tried it now for hours but still cannot change every value that is not 0 into something else. Replace()-function don't work really good for that. Some good ideas?
EDIT (my solution):
finalResult.loc[finalResult['update_user'] == '0', 'update_user'] = 'empty'
finalResult.loc[finalResult['update_user'] != 'empty', 'update_user'] = 'not empty'
df['User_id'] = df['User_id'].replace('0', 'is not empty')does not work?