I have a pandas series such as the following:
that contains exactly two falses. I would like to flip one of the False values randomly to a True. Alternatively, how can I change the first or second occurrence to True. I tried the replace function but it changes everything to True. Any help is appreciated.
Would have expected the following to do the job:
mask.ix[mask==False][np.random.randint(2)] = True