Please enable JavaScript.
Coggle requires JavaScript to display documents.
(def plot_and_save_selected_features(df, start_date=None, end_date=None,…
def plot_and_save_selected_features(df, start_date=None, end_date=None, save_csv=True):
-
-
-
-
-
-
-
if save_csv:
-
df.to_csv(csv_filename, index=False)
-
-
-
-
-
-
-
fig, axes = plt.subplots(nrows=num_rows, ncols=num_cols, figsize=(15, 5 * num_rows))
for idx, feature in enumerate(selected_features):
row, col = divmod(idx, num_cols)
axes[row, col].plot(df["Date"], df[feature])
axes[row, col].set_title(feature)
axes[row, col].set_ylabel("Value")
axes[row, col].set_xlabel("Date (UTC)")
axes[row, col].grid(True) # Enable the grid
-
for j in range(idx + 1, num_rows * num_cols):
row, col = divmod(j, num_cols)
fig.delaxes(axes[row, col])
-
-
-
-
-
-
-
-
directory_path = "./SAM Downloaded Weather Files/10029_massachusetts_essex42.6762973-70.9486776" # Replace with the path to your CSV files folder
-
filtered_df = plot_and_save_selected_features(merged_data, start_date="2017-11-01", end_date="2017-11-30")