Advertisement
Guest User

Untitled

a guest
Feb 28th, 2020
214
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.51 KB | None | 0 0
  1. np.random.seed(0)
  2.  
  3. def get_random_points(linear_mult, random_mult):
  4.   return np.concatenate([linear_mult * np.arange(5) + random_mult * np.random.rand(5),
  5.                          linear_mult * np.arange(5) + random_mult * np.random.rand(5)])
  6.  
  7. df = pd.DataFrame({
  8.     'line_name': np.concatenate([np.repeat('l1', 5),  np.repeat('l2', 5)]),
  9.     'x': get_random_points(3, 1),
  10.     'y':  get_random_points(3, 4),
  11.     't': get_random_points(1, 1),
  12.     't_i': get_random_points(1, 0)})
  13. df.t_i = df.t_i.astype(int)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement