Created
February 19, 2021 06:51
-
-
Save zredlined/1649cd490fdafd4cb013bbebf4465d97 to your computer and use it in GitHub Desktop.
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
def plot_timeseries(filenames: list): | |
""" Plot a list of timeseries CSVs to a single graph """ | |
combined_df = pd.DataFrame() | |
for filename in filenames: | |
df = pd.read_csv(filename) | |
df['date'] = pd.to_datetime(df['date']) | |
df['label'] = filename | |
combined_df = pd.concat([combined_df, df]) | |
combined_df.set_index('date', inplace=True) | |
combined_df.plot(color="label").show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment