diff options
author | Russell Manser <russell.p.manser@ttu.edu> | 2020-07-03 11:52:13 -0500 |
---|---|---|
committer | Russell Manser <russell.p.manser@ttu.edu> | 2020-07-03 11:52:13 -0500 |
commit | a26e2d771bc1f1afe9b4abab96dfa84b0de76e7e (patch) | |
tree | 3c96d33ec2a11629a56572991f2b95e8605e7f40 /docs | |
parent | 2617280a7e10de277f8ee236f1d476e2288e463b (diff) | |
download | pint-a26e2d771bc1f1afe9b4abab96dfa84b0de76e7e.tar.gz |
Update docs with Pint Quantity wrapped Dask Array
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, |