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/4319#issuecomment-670009054,https://api.github.com/repos/pydata/xarray/issues/4319,670009054,MDEyOklzc3VlQ29tbWVudDY3MDAwOTA1NA==,2448579,2020-08-06T15:43:43Z,2020-08-06T15:43:43Z,MEMBER,Closing as duplicate. Thanks @malmans2 for reporting.,"{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,674379292 https://github.com/pydata/xarray/issues/4319#issuecomment-669983853,https://api.github.com/repos/pydata/xarray/issues/4319,669983853,MDEyOklzc3VlQ29tbWVudDY2OTk4Mzg1Mw==,14808389,2020-08-06T15:02:54Z,2020-08-06T15:22:55Z,MEMBER,"Thanks for the report, @malmans2. This is a general issue with `sel` / `loc` with datetime dtypes, see #4283 and #4292; we're working on this. Unfortunately, our test coverage was not complete enough for us to catch that before the `pandas` release. For now, you might want to pin `pandas` to `pandas<1.1.0`.","{""total_count"": 2, ""+1"": 0, ""-1"": 0, ""laugh"": 1, ""hooray"": 1, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,674379292 https://github.com/pydata/xarray/issues/4319#issuecomment-669985622,https://api.github.com/repos/pydata/xarray/issues/4319,669985622,MDEyOklzc3VlQ29tbWVudDY2OTk4NTYyMg==,22245117,2020-08-06T15:05:57Z,2020-08-06T15:05:57Z,CONTRIBUTOR,Got it! Thanks @keewis.,"{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,674379292 https://github.com/pydata/xarray/issues/4319#issuecomment-669982126,https://api.github.com/repos/pydata/xarray/issues/4319,669982126,MDEyOklzc3VlQ29tbWVudDY2OTk4MjEyNg==,22245117,2020-08-06T15:00:04Z,2020-08-06T15:00:04Z,CONTRIBUTOR,"Here is the full error: ``` --------------------------------------------------------------------------- KeyError Traceback (most recent call last) in ----> 1 airtemps['air'].isel(time=slice(2)).plot(col='time') ~/anaconda3/envs/ospy_tests/lib/python3.7/site-packages/xarray/plot/plot.py in __call__(self, **kwargs) 444 445 def __call__(self, **kwargs): --> 446 return plot(self._da, **kwargs) 447 448 # we can't use functools.wraps here since that also modifies the name / qualname ~/anaconda3/envs/ospy_tests/lib/python3.7/site-packages/xarray/plot/plot.py in plot(darray, row, col, col_wrap, ax, hue, rtol, subplot_kws, **kwargs) 198 kwargs[""ax""] = ax 199 --> 200 return plotfunc(darray, **kwargs) 201 202 ~/anaconda3/envs/ospy_tests/lib/python3.7/site-packages/xarray/plot/plot.py in newplotfunc(darray, x, y, figsize, size, aspect, ax, row, col, col_wrap, xincrease, yincrease, add_colorbar, add_labels, vmin, vmax, cmap, center, robust, extend, levels, infer_intervals, colors, subplot_kws, cbar_ax, cbar_kwargs, xscale, yscale, xticks, yticks, xlim, ylim, norm, **kwargs) 636 # Need the decorated plotting function 637 allargs[""plotfunc""] = globals()[plotfunc.__name__] --> 638 return _easy_facetgrid(darray, kind=""dataarray"", **allargs) 639 640 plt = import_matplotlib_pyplot() ~/anaconda3/envs/ospy_tests/lib/python3.7/site-packages/xarray/plot/facetgrid.py in _easy_facetgrid(data, plotfunc, kind, x, y, row, col, col_wrap, sharex, sharey, aspect, size, subplot_kws, ax, figsize, **kwargs) 642 643 if kind == ""dataarray"": --> 644 return g.map_dataarray(plotfunc, x, y, **kwargs) 645 646 if kind == ""dataset"": ~/anaconda3/envs/ospy_tests/lib/python3.7/site-packages/xarray/plot/facetgrid.py in map_dataarray(self, func, x, y, **kwargs) 263 # Get x, y labels for the first subplot 264 x, y = _infer_xy_labels( --> 265 darray=self.data.loc[self.name_dicts.flat[0]], 266 x=x, 267 y=y, ~/anaconda3/envs/ospy_tests/lib/python3.7/site-packages/xarray/core/dataarray.py in __getitem__(self, key) 196 labels = indexing.expanded_indexer(key, self.data_array.ndim) 197 key = dict(zip(self.data_array.dims, labels)) --> 198 return self.data_array.sel(**key) 199 200 def __setitem__(self, key, value) -> None: ~/anaconda3/envs/ospy_tests/lib/python3.7/site-packages/xarray/core/dataarray.py in sel(self, indexers, method, tolerance, drop, **indexers_kwargs) 1152 method=method, 1153 tolerance=tolerance, -> 1154 **indexers_kwargs, 1155 ) 1156 return self._from_temp_dataset(ds) ~/anaconda3/envs/ospy_tests/lib/python3.7/site-packages/xarray/core/dataset.py in sel(self, indexers, method, tolerance, drop, **indexers_kwargs) 2100 indexers = either_dict_or_kwargs(indexers, indexers_kwargs, ""sel"") 2101 pos_indexers, new_indexes = remap_label_indexers( -> 2102 self, indexers=indexers, method=method, tolerance=tolerance 2103 ) 2104 result = self.isel(indexers=pos_indexers, drop=drop) ~/anaconda3/envs/ospy_tests/lib/python3.7/site-packages/xarray/core/coordinates.py in remap_label_indexers(obj, indexers, method, tolerance, **indexers_kwargs) 395 396 pos_indexers, new_indexes = indexing.remap_label_indexers( --> 397 obj, v_indexers, method=method, tolerance=tolerance 398 ) 399 # attach indexer's coordinate to pos_indexers ~/anaconda3/envs/ospy_tests/lib/python3.7/site-packages/xarray/core/indexing.py in remap_label_indexers(data_obj, indexers, method, tolerance) 268 coords_dtype = data_obj.coords[dim].dtype 269 label = maybe_cast_to_coords_dtype(label, coords_dtype) --> 270 idxr, new_idx = convert_label_indexer(index, label, dim, method, tolerance) 271 pos_indexers[dim] = idxr 272 if new_idx is not None: ~/anaconda3/envs/ospy_tests/lib/python3.7/site-packages/xarray/core/indexing.py in convert_label_indexer(index, label, index_name, method, tolerance) 188 else: 189 indexer = index.get_loc( --> 190 label.item(), method=method, tolerance=tolerance 191 ) 192 elif label.dtype.kind == ""b"": ~/anaconda3/envs/ospy_tests/lib/python3.7/site-packages/pandas/core/indexes/datetimes.py in get_loc(self, key, method, tolerance) 620 else: 621 # unrecognized type --> 622 raise KeyError(key) 623 624 try: KeyError: 1356998400000000000 ```","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,674379292