use loc and where
cols = ['a', 'b', 'c'] df.loc[:, cols] = df[cols].where(df[cols].where.ge(0), np.nan)
demonstration
df = pd.DataFrame(np.random.randn(10, 5), columns=list('abcde')) df

cols = list('abc') df.loc[:, cols] = df[cols].where(df[cols].ge(0), np.nan) df

You can speed it up with numpy
df[cols] = np.where(df[cols] < 0, np.nan, df[cols])
do the same thing.
time
def gen_df(n): return pd.DataFrame(np.random.randn(n, 5), columns=list('abcde'))
since assignment is an important part of this, I create df from scratch every loop. I also added time to create df .
for n = 10000

for n = 100000

source share