Reputation: 2366
I have a DataFrame, size N. I need to sample it with S samples, with replacement where N < S.
def sampleDF(df, K):
return df.ix[np.random.randint(0, len(df), size=k)]
I return a new DF but it seems everything is filled with NaN. Am not sure what's going on!
Upvotes: 4
Views: 3672