Skip to content

Commit

Permalink
added exception to handle empty ecy_df in 0c.
Browse files Browse the repository at this point in the history
  • Loading branch information
barkermi committed Jan 9, 2025
1 parent 6d323e4 commit 16a1c80
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion 0c_Create_Streamflow_Observations_v3.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -652,7 +652,10 @@
" NWIS_OWRD_clean = NWIS_OWRD_joined[~NWIS_OWRD_joined.index.duplicated(keep='first')]\n",
" \n",
" # Merge with ECY\n",
" NWIS_OWRD_ECY_joined = pd.concat([NWIS_OWRD_clean, ecy_df])\n",
" if ecy_df:\n",
" NWIS_OWRD_ECY_joined = pd.concat([NWIS_OWRD_clean, ecy_df])\n",
" else:\n",
" NWIS_OWRD_ECY_joined = NWIS_OWRD_clean\n",
" # drop duplicated indexes, keeping the last occurence (ECY occurs last). Only dups now should be ecy\n",
" # try following this thing: https://saturncloud.io/blog/how-to-drop-duplicated-index-in-a-pandas-dataframe-a-complete-guide/#:~:text=Pandas%20provides%20the%20drop_duplicates(),names%20to%20the%20subset%20parameter.\n",
" NWIS_OWRD_ECY_clean = NWIS_OWRD_ECY_joined[~NWIS_OWRD_ECY_joined.index.duplicated(keep='last')]\n",
Expand Down

0 comments on commit 16a1c80

Please sign in to comment.