Last active
August 28, 2022 21:04
-
-
Save czming/6f188498391900f081a16f6fec91711c to your computer and use it in GitHub Desktop.
Visualizes pre-filtered and filtered data #aits
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
# columns in the data that you want to visualize (visualize each column's value along the rows, where the row number is the x-axis) | |
VISUALIZED_COLUMNS = [0, -1, -2, -3, -4] | |
# show visualization of data, change to only one column (second argument) if only want to visualize current set of data instead of contrasting pre- vs post-filtering | |
fig, axs = plt.subplots(len(VISUALIZED_COLUMNS), 2) | |
for i, column in enumerate(VISUALIZED_COLUMNS): | |
old_data = data[:, column] | |
# plot pre-filtered data | |
axs[i, 0].plot(range(len(data)), old_data) | |
# convolved_data is the data that has been filtered | |
filtered_data = convolved_data[:, column] | |
axs[i, 1].plot(range(len(data)), filtered_data) | |
axs[0, 0].set_title("Original data") | |
axs[0, 1].set_title("Filtered data") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment