python - Numpy, getting data from column A or B depending if condition is met to create column C -
i have 2 columns of data in array 1 column of useful information. come different sources why in 2 columns.
what i'd take value first or second column, depending on if condition met. value inserted new column. new column useful information column 1 , 2. if condition not met in either column enters blank.
is there easy , efficient way in numpy?
here sample table:
name gathered_name john 0 0 jack 0 0 and result like:
column3 john jack "" <--empty string don't worry condition, have worked out regex handle that...assume in scenario, condition if != 0
Comments
Post a Comment