diff options
Diffstat (limited to 'docs')
-rw-r--r-- | docs/numpy.ipynb | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/docs/numpy.ipynb b/docs/numpy.ipynb index c3e8fc9..65768f6 100644 --- a/docs/numpy.ipynb +++ b/docs/numpy.ipynb @@ -384,6 +384,31 @@ "cell_type": "markdown", "metadata": {}, "source": [ + "**Pint Quantity wrapping Dask Array**" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "import dask.array as da\n", + "\n", + "d = da.arange(500, chunks=50)\n", + "\n", + "# Must create using Quantity class, otherwise Dask will wrap Pint Quantity\n", + "q = ureg.Quantity(d, ureg.kelvin)\n", + "\n", + "print(repr(q))\n", + "print()\n", + "print(repr(d * ureg.kelvin))" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ "**xarray wrapping Pint Quantity wrapping Dask array wrapping Sparse COO**" ] }, @@ -465,7 +490,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.7.6" + "version": "3.8.3" } }, "nbformat": 4, |