Last active
July 15, 2018 06:30
-
-
Save BlogBlocks/58a6950f20d982ce4fbf294da9921191 to your computer and use it in GitHub Desktop.
Splits a numpy single column array into two columns (odd,even)then graphs each column separately on the same plot
This file contains 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.pyplot as plt | |
""" | |
Divides a single column of a numpy array | |
in odd and even rows. Then graphs the odd | |
rows and the even rows seperatley | |
""" | |
# Numpy array - single column | |
sc = np.load("s-Numy-plot.npy") | |
# Odd numbers of the single column | |
x = sc[0:][::2] | |
# Even numbers of the single column | |
y = sc[1:][::2] | |
#smooth = raw.reshape(10,178).mean(axis=1) | |
N = len(sc) | |
x1 = np.linspace(0, 1, N/2) | |
x2 = np.linspace(0, 1, N/2) | |
#x1 = np.linspace(0, 1, ss) | |
#x2 = np.linspace(0, 1, 178) | |
plt.plot(x1, y) | |
plt.plot(x2, x) | |
plt.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment