Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- np.random.seed(0)
- def get_random_points(linear_mult, random_mult):
- return np.concatenate([linear_mult * np.arange(5) + random_mult * np.random.rand(5),
- linear_mult * np.arange(5) + random_mult * np.random.rand(5)])
- df = pd.DataFrame({
- 'line_name': np.concatenate([np.repeat('l1', 5), np.repeat('l2', 5)]),
- 'x': get_random_points(3, 1),
- 'y': get_random_points(3, 4),
- 't': get_random_points(1, 1),
- 't_i': get_random_points(1, 0)})
- df.t_i = df.t_i.astype(int)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement