Skip to content

Commit 1faf67c

Browse files
mickaellalandedcherian
authored andcommitted
Fix leap year condition in monthly means example (#3464)
* Typo correction in docs (#3387) * Update terminology.rst (#3455) Fixed broken link * Error in leap year? I've tried this script; however, it adds +1 to all months of the leap years. It sounds like an error, or I am wrong? So I wrote the condition "and month == 2" line 86 so that only the month of February gets +1. * Fix leap year (#3464) * Update doc/whats-new.rst Co-Authored-By: Deepak Cherian <[email protected]>
1 parent d502ae2 commit 1faf67c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

doc/examples/monthly-means.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@
107107
" \n",
108108
" for i, (month, year) in enumerate(zip(time.month, time.year)):\n",
109109
" month_length[i] = cal_days[month]\n",
110-
" if leap_year(year, calendar=calendar):\n",
110+
" if leap_year(year, calendar=calendar) and month == 2:\n",
111111
" month_length[i] += 1\n",
112112
" return month_length"
113113
]

0 commit comments

Comments
 (0)