home / github / issue_comments

Menu
  • Search all tables
  • GraphQL API

issue_comments: 351661580

This data as json

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/1780#issuecomment-351661580 https://api.github.com/repos/pydata/xarray/issues/1780 351661580 MDEyOklzc3VlQ29tbWVudDM1MTY2MTU4MA== 10050469 2017-12-14T09:51:01Z 2017-12-14T09:51:01Z MEMBER

Yes, I agree. We inherited the logic from seaborn, which also has this problem:

```python In [2]: import seaborn as sns In [3]: import numpy as np In [4]: a = np.zeros((2, 2)) * np.NaN In [6]: sns.heatmap(a)


ValueError Traceback (most recent call last) <ipython-input-6-9ef15135ade2> in <module>() ----> 1 sns.heatmap(a)

~/.pyvirtualenvs/py3/lib/python3.5/site-packages/seaborn/matrix.py in heatmap(data, vmin, vmax, cmap, center, robust, annot, fmt, annot_kws, linewidths, linecolor, cbar, cbar_kws, cbar_ax, square, xticklabels, yticklabels, mask, ax, **kwargs) 515 plotter = _HeatMapper(data, vmin, vmax, cmap, center, robust, annot, fmt, 516 annot_kws, cbar, cbar_kws, xticklabels, --> 517 yticklabels, mask) 518 519 # Add the pcolormesh kwargs here

~/.pyvirtualenvs/py3/lib/python3.5/site-packages/seaborn/matrix.py in init(self, data, vmin, vmax, cmap, center, robust, annot, fmt, annot_kws, cbar, cbar_kws, xticklabels, yticklabels, mask) 166 # Determine good default values for the colormapping 167 self._determine_cmap_params(plot_data, vmin, vmax, --> 168 cmap, center, robust) 169 170 # Sort out the annotations

~/.pyvirtualenvs/py3/lib/python3.5/site-packages/seaborn/matrix.py in _determine_cmap_params(self, plot_data, vmin, vmax, cmap, center, robust) 205 calc_data = plot_data.data[~np.isnan(plot_data.data)] 206 if vmin is None: --> 207 vmin = np.percentile(calc_data, 2) if robust else calc_data.min() 208 if vmax is None: 209 vmax = np.percentile(calc_data, 98) if robust else calc_data.max()

~/.pyvirtualenvs/py3/lib/python3.5/site-packages/numpy/core/_methods.py in _amin(a, axis, out, keepdims) 27 28 def _amin(a, axis=None, out=None, keepdims=False): ---> 29 return umr_minimum(a, axis, None, out, keepdims) 30 31 def _sum(a, axis=None, dtype=None, out=None, keepdims=False):

ValueError: zero-size array to reduction operation minimum which has no identity

```

Will try to submit a fix later today

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  282000017
Powered by Datasette · Queries took 239.163ms · About: xarray-datasette