Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save andrewm4894/62174bbf299ecb36cada254314290644 to your computer and use it in GitHub Desktop.
Save andrewm4894/62174bbf299ecb36cada254314290644 to your computer and use it in GitHub Desktop.
# make some random data
data_rand = np.random.rand(N_DATA,N_FEATURES)
data_new = np.copy(data)
# at a random point for a certain number of steps, swap out the smooth data with some random data
data_new[random_break_point:(random_break_point+BREAK_LEN)] = data_rand[random_break_point:(random_break_point+BREAK_LEN)]
# plot the new data
fig, ax = plt.subplots(num=None, figsize=(14, 6), dpi=80, facecolor='w', edgecolor='k')
size = len(data_new)
for x in range(data_new.shape[1]):
ax.plot(range(0,size), data_new[:,x], '-', linewidth=0.5)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment