The following is a sub-set of data frame:
id words A B C D E
1 new 1 1
2 good 1
3 star 1
4 never
5 final
I want to define a new variable (called FF) as a new column and assign 1 to it, if values for all other variables (columns) are "null". The new data frame would be like this:
id words A B C D E FF
1 new 1 1
2 good 1
3 star 1
4 never 1
5 final 1
How I can do it using python and Pandas ? Thanks.