Given an array of timedeltas, returns a CF compatible time-unit from {'days', 'hours', 'minutes' 'seconds'} (the first one that can evenly divide all unique time deltas in `deltas`)
(deltas)
| 796 | |
| 797 | |
| 798 | def infer_timedelta_units(deltas) -> str: |
| 799 | """Given an array of timedeltas, returns a CF compatible time-unit from |
| 800 | {'days', 'hours', 'minutes' 'seconds'} (the first one that can evenly |
| 801 | divide all unique time deltas in `deltas`) |
| 802 | """ |
| 803 | deltas = ravel(deltas) |
| 804 | unique_timedeltas = np.unique(deltas[pd.notnull(deltas)]) |
| 805 | return _infer_time_units_from_diff(unique_timedeltas) |
| 806 | |
| 807 | |
| 808 | def cftime_to_nptime( |
searching dependent graphs…