html_url,issue_url,id,node_id,user,created_at,updated_at,author_association,body,reactions,performed_via_github_app,issue https://github.com/pydata/xarray/issues/2667#issuecomment-453667107,https://api.github.com/repos/pydata/xarray/issues/2667,453667107,MDEyOklzc3VlQ29tbWVudDQ1MzY2NzEwNw==,6815844,2019-01-11T21:46:10Z,2019-01-11T21:46:10Z,MEMBER,"Thanks. Then, it would be probably nice if `datetime_to_numeric` only accepts np.ndarray and da.array not Variable or DataArray, and move this function to duck_array_ops. I'll send a fix.","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,398152613 https://github.com/pydata/xarray/issues/2667#issuecomment-453666317,https://api.github.com/repos/pydata/xarray/issues/2667,453666317,MDEyOklzc3VlQ29tbWVudDQ1MzY2NjMxNw==,1217238,2019-01-11T21:43:08Z,2019-01-11T21:43:08Z,MEMBER,"I think the best we can do is to is use masking on the result, e.g., with `np.where`.","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,398152613 https://github.com/pydata/xarray/issues/2667#issuecomment-453665698,https://api.github.com/repos/pydata/xarray/issues/2667,453665698,MDEyOklzc3VlQ29tbWVudDQ1MzY2NTY5OA==,6815844,2019-01-11T21:40:50Z,2019-01-11T21:40:50Z,MEMBER,"Is there a good way to convert a timedelta array including `NaT` to a float array with `nan`? `array.astype(float)` makes `NaT` a certain large value. ```python In [1]: import numpy as np In [2]: import pandas as pd In [3]: time = np.array(pd.date_range('15/12/1999', periods=11)) In [4]: time[8: 11] = np.nan In [5]: time Out[5]: array(['1999-12-15T00:00:00.000000000', '1999-12-16T00:00:00.000000000', '1999-12-17T00:00:00.000000000', '1999-12-18T00:00:00.000000000', '1999-12-19T00:00:00.000000000', '1999-12-20T00:00:00.000000000', '1999-12-21T00:00:00.000000000', '1999-12-22T00:00:00.000000000', 'NaT', 'NaT', 'NaT'], dtype='datetime64[ns]') In [6]: time.astype(float) Out[6]: array([ 9.45216000e+17, 9.45302400e+17, 9.45388800e+17, 9.45475200e+17, 9.45561600e+17, 9.45648000e+17, 9.45734400e+17, 9.45820800e+17, -9.22337204e+18, -9.22337204e+18, -9.22337204e+18]) In [7]: (time - np.min(time)).astype(float) Out[7]: array([ 0.00000000e+00, 8.64000000e+13, 1.72800000e+14, 2.59200000e+14, 3.45600000e+14, 4.32000000e+14, 5.18400000e+14, 6.04800000e+14, -9.22337204e+18, -9.22337204e+18, -9.22337204e+18]) ```","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,398152613 https://github.com/pydata/xarray/issues/2667#issuecomment-453399209,https://api.github.com/repos/pydata/xarray/issues/2667,453399209,MDEyOklzc3VlQ29tbWVudDQ1MzM5OTIwOQ==,6815844,2019-01-11T06:57:01Z,2019-01-11T06:57:01Z,MEMBER,Oops. This is definitely my bug. This line should return a Variable. I will send a fix.,"{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,398152613