rand numpy code example
Example 1: Random Numbers in NumPy
from numpy import random
x = random.randint(100)
print(x)
Example 2: np.random.rand()
# train test split
df = pd.read_csv('file_location')
mask = np.random.rand(len(df)) < 0.8
train = df[mask]
test = df[~mask]