Last active
August 26, 2018 03:14
-
-
Save traderpro446/8214b5135d1a1a8f7e1e0fcddb85e1ef to your computer and use it in GitHub Desktop.
sine wave
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import numpy as np | |
| import matplotlib.pylab as plt | |
| def sine_wave(numOfPointsPerCycle=60,numOfCycls=24,A=0.25,display=False): | |
| x = np.linspace(0, 2*np.pi*numOfCycls, numOfCycls*numOfPointsPerCycle) | |
| y= 1+A*np.sin(x) | |
| if display is False: | |
| return y | |
| x=range(len(y)) | |
| plt.figure(figsize=(15,5)) | |
| plt.plot(x,y) | |
| plt.xlabel('time') | |
| plt.ylabel('price') | |
| plt.axis('tight') | |
| plt.show() | |
| return y |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment