def test_infer_timedelta_units(self): for deltas, expected in [ (pd.to_timedelta(['1 day', '2 days']), 'days'), (pd.to_timedelta(['1h', '1 day 1 hour']), 'hours'), (pd.to_timedelta(['1m', '2m', np.nan]), 'minutes'), (pd.to_timedelta(['1m3s', '1m4s']), 'seconds')]: self.assertEqual(expected, conventions.infer_timedelta_units(deltas))