March 2020
Beginner to intermediate
352 pages
8h 40m
English
To compute random sampling without replacement, follow these steps:
df.take(np.random.permutation(len(df))[:3])
The output of the preceding code is as follows:

Note that in the preceding code, we only specified a sample of size 3. Hence, we only get three rows in the random sample.
Read now
Unlock full access