You can create a random DataFrame, then generate random column numbers and replace those columns for each row with NaN. You can run it here.
import pandas as pd
import numpy as np
import random
rows = 5
cols = 10
nan_n = 5
df = pd.DataFrame(np.random.randint(0,100,size=(rows, cols)))
print(df)
for row in range(0,rows):
nan_cols = np.asarray(random.sample(range(0, 10), nan_n))
df.at[row, nan_cols] = np.nan
print(df)