@@ -239,7 +239,7 @@ def convert_from_freq(values, freq):
239239
240240 @staticmethod
241241 def _convert_1d (values , freq ):
242- valid_types = (str , datetime , Period , pydt .date , pydt . time , np .datetime64 )
242+ valid_types = (str , datetime , Period , pydt .date , np .datetime64 )
243243 with warnings .catch_warnings ():
244244 warnings .filterwarnings (
245245 "ignore" , "Period with BDay freq is deprecated" , category = FutureWarning
@@ -261,21 +261,17 @@ def _convert_1d(values, freq):
261261 # https://github.com/pandas-dev/pandas/issues/24304
262262 # convert ndarray[period] -> PeriodIndex
263263 return PeriodIndex (values , freq = freq ).asi8
264- elif isinstance (values , (list , tuple , np .ndarray , Index )):
264+ elif isinstance (values , (list , tuple , np .ndarray )):
265265 return [_get_datevalue (x , freq ) for x in values ]
266266 return values
267267
268268
269269def _get_datevalue (date , freq ):
270270 if isinstance (date , Period ):
271271 return date .asfreq (freq ).ordinal
272- elif isinstance (date , (str , datetime , pydt .date , pydt . time , np .datetime64 )):
272+ elif isinstance (date , (str , datetime , pydt .date , np .datetime64 )):
273273 return Period (date , freq ).ordinal
274- elif (
275- is_integer (date )
276- or is_float (date )
277- or (isinstance (date , (np .ndarray , Index )) and (date .size == 1 ))
278- ):
274+ elif is_integer (date ) or is_float (date ):
279275 return date
280276 elif date is None :
281277 return None
0 commit comments