File tree 2 files changed +10
-0
lines changed
2 files changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -926,6 +926,7 @@ def _get_wom_rule(self):
926
926
return None
927
927
928
928
week_of_months = unique ((self .index .day - 1 ) // 7 )
929
+ week_of_months = week_of_months [week_of_months < 4 ]
929
930
if len (week_of_months ) > 1 :
930
931
return None
931
932
Original file line number Diff line number Diff line change @@ -210,6 +210,15 @@ def test_week_of_month(self):
210
210
for day in days :
211
211
for i in range (1 , 5 ):
212
212
self ._check_generated_range ('1/1/2000' , 'WOM-%d%s' % (i , day ))
213
+ self ._check_generated_range ('1/1/2000' , 'WOM-%d%s' % (i , day ))
214
+
215
+ def test_fifth_week_of_month (self ):
216
+ func = lambda : date_range ('2014-01-01' , freq = 'WOM-5MON' )
217
+ self .assertRaises (ValueError , func )
218
+
219
+ def test_fifth_week_of_month_infer (self ):
220
+ index = DatetimeIndex (["2014-03-31" , "2014-06-30" , "2015-03-30" ])
221
+ assert frequencies .infer_freq (index ) is None
213
222
214
223
def test_week_of_month_fake (self ):
215
224
#All of these dates are on same day of week and are 4 or 5 weeks apart
You can’t perform that action at this time.
0 commit comments