Created
October 13, 2024 12:09
-
-
Save Tusenka/047532cabd0f87d4e86d7121459fbdb0 to your computer and use it in GitHub Desktop.
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 pandas as pd | |
| import matplotlib.pyplot as plt | |
| def to_range(y): | |
| return to_strings(list(range(y.count()))) | |
| def to_strings(y): | |
| return list(map(str, y)) | |
| def is_number(x): | |
| try: | |
| return x.replace('.','',1).isdigit() | |
| except Exception: | |
| return False | |
| def create_plot(p, y, name): | |
| if not is_number(y[3]): | |
| return | |
| x=to_range(y) | |
| p.plot(x, to_strings(y)) | |
| p.set_title(name) | |
| def count_plot(workbook): | |
| len(workbook.keys()) | |
| workbook = pd.read_excel('data.xlsx') | |
| fig, axs = plt.subplots(len(workbook.keys())) | |
| fig.suptitle('Vertically stacked subplots') | |
| i=0 | |
| for key in workbook.keys(): | |
| create_plot(axs[i],workbook[key].dropna(), key) | |
| i+=1 | |
| plt.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment