Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
malmans2 committed Apr 4, 2024
1 parent 476d108 commit ae5d99d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion notebooks/wp5/glacier_distribution.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,9 @@
" date = date.where(~date.str.startswith(\"-\"))\n",
" columns.append(pd.to_datetime(date))\n",
"dates = pd.DataFrame(columns).mean()\n",
"gdf[\"decimal_year\"] = dates.year + (dates.dayofyear - 1) / (364 + dates.is_leap_year)\n",
"gdf[\"decimal_year\"] = dates.dtyear + (dates.dt.dayofyear - 1) / (\n",
" 364 + dates.dt.is_leap_year\n",
")\n",
"gdf[\"year\"] = dates.dt.year.astype(\"Int64\")"
]
},
Expand Down

0 comments on commit ae5d99d

Please sign in to comment.