In [ ]:
%matplotlib inline
import numpy as np
import matplotlib.pyplot as plt
import numpy.random as rndm
In [ ]:
#This is fake data representing a time series
t = np.linspace(0,100,1000)
signal = rndm.randn(1000)+10.
i = 0
while (i < 50):
signal[rndm.randint(0,999)] += 30.
i += 1
plt.plot(t,signal)
plt.show()
plt.plot(t[np.where(signal<15.)],signal[np.where(signal<15.)])
plt.show()
In [ ]:
#Creating output text file for time series
outArray = np.array([t,signal])
np.savetxt('./lecture2_data/timeseries_data.txt',outArray)