diff --git a/waternsw_grabber/waternsw_grabber.py b/waternsw_grabber/waternsw_grabber.py index 4d10ab9..a0448ab 100644 --- a/waternsw_grabber/waternsw_grabber.py +++ b/waternsw_grabber/waternsw_grabber.py @@ -506,6 +506,10 @@ def extract_records(input_dir, output_dir, clean_up=False): for basin_code in basin_codes: for period in periods: + # Ignore empty dataframes + if len(master[basin_code][period]) == 0: + continue + # Get latest date from dataframe latest_date = master[basin_code][period].index[-1].strftime( '%Y-%m-%d')