Skip empty dataframes when processing multiple basins

master
Dan Howe 6 years ago
parent 1f3afb408b
commit 9ad2fdea33

@ -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')

Loading…
Cancel
Save