Skip to content
Advertisement

Fill empty cells in column with value of other columns

I have a HC list in which every entry should have an ID, but some entries do not have an ID. I would like to fill those empty cells by combining the the first name column and the last name column. How would I go about this? I tried googling for fillna and the like but couldn’t get it to work. What I want is basically this:

JavaScript

Advertisement

Answer

You can use loc and a boolean mask if NaN then:

JavaScript

otherwise for empty string:

JavaScript
User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement