| 1911 | zip([None, 0, [0], [0, 1]], [None, "x", ["x"], ["x", "y"]], strict=True), |
| 1912 | ) |
| 1913 | def test_quantile(self, q, axis, dim, skipna): |
| 1914 | d = self.d.copy() |
| 1915 | d[0, 0] = np.nan |
| 1916 | |
| 1917 | v = Variable(["x", "y"], d) |
| 1918 | actual = v.quantile(q, dim=dim, skipna=skipna) |
| 1919 | _percentile_func = np.nanpercentile if skipna in (True, None) else np.percentile |
| 1920 | expected = _percentile_func(d, np.array(q) * 100, axis=axis) |
| 1921 | np.testing.assert_allclose(actual.values, expected) |
| 1922 | |
| 1923 | @requires_dask |
| 1924 | @pytest.mark.parametrize("q", [0.25, [0.50], [0.25, 0.75]]) |