{ "cells": [ { "cell_type": "markdown", "id": "optional-abraham", "metadata": {}, "source": [ "# Introduction\n", "\n", "The dask library provides parallel versions of many operations available in numpy and pandas. It does this by breaking up an array into chunks.\n", "\n", "The full documentation for the Dask library is available at https://docs.dask.org/en/latest/" ] }, { "cell_type": "code", "execution_count": 1, "id": "applicable-bunny", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n",
"
| \n",
"\n", "\n", " | \n", "
\n",
"
| \n",
"\n", "\n", " | \n", "
<xarray.DataArray 'tas' (time: 1980, lat: 144, lon: 192)>\n", "dask.array<open_dataset-0e410aadf9156f5cf0b6cd8c2849d202tas, shape=(1980, 144, 192), dtype=float32, chunksize=(1, 144, 192), chunktype=numpy.ndarray>\n", "Coordinates:\n", " * time (time) datetime64[ns] 1850-01-16T12:00:00 ... 2014-12-16T12:00:00\n", " * lat (lat) float64 -89.38 -88.12 -86.88 -85.62 ... 86.88 88.12 89.38\n", " * lon (lon) float64 0.9375 2.812 4.688 6.562 ... 353.4 355.3 357.2 359.1\n", " height float64 ...\n", "Attributes:\n", " standard_name: air_temperature\n", " long_name: Near-Surface Air Temperature\n", " comment: near-surface (usually, 2 meter) air temperature\n", " units: K\n", " cell_methods: area: time: mean\n", " cell_measures: area: areacella\n", " history: 2019-11-08T06:41:45Z altered by CMOR: Treated scalar dime...\n", " _ChunkSizes: [ 1 144 192]
\n",
"
| \n",
"\n", "\n", " | \n", "
array(['1850-01-16T12:00:00.000000000', '1850-02-15T00:00:00.000000000',\n", " '1850-03-16T12:00:00.000000000', ..., '2014-10-16T12:00:00.000000000',\n", " '2014-11-16T00:00:00.000000000', '2014-12-16T12:00:00.000000000'],\n", " dtype='datetime64[ns]')
array([-89.375, -88.125, -86.875, -85.625, -84.375, -83.125, -81.875, -80.625,\n", " -79.375, -78.125, -76.875, -75.625, -74.375, -73.125, -71.875, -70.625,\n", " -69.375, -68.125, -66.875, -65.625, -64.375, -63.125, -61.875, -60.625,\n", " -59.375, -58.125, -56.875, -55.625, -54.375, -53.125, -51.875, -50.625,\n", " -49.375, -48.125, -46.875, -45.625, -44.375, -43.125, -41.875, -40.625,\n", " -39.375, -38.125, -36.875, -35.625, -34.375, -33.125, -31.875, -30.625,\n", " -29.375, -28.125, -26.875, -25.625, -24.375, -23.125, -21.875, -20.625,\n", " -19.375, -18.125, -16.875, -15.625, -14.375, -13.125, -11.875, -10.625,\n", " -9.375, -8.125, -6.875, -5.625, -4.375, -3.125, -1.875, -0.625,\n", " 0.625, 1.875, 3.125, 4.375, 5.625, 6.875, 8.125, 9.375,\n", " 10.625, 11.875, 13.125, 14.375, 15.625, 16.875, 18.125, 19.375,\n", " 20.625, 21.875, 23.125, 24.375, 25.625, 26.875, 28.125, 29.375,\n", " 30.625, 31.875, 33.125, 34.375, 35.625, 36.875, 38.125, 39.375,\n", " 40.625, 41.875, 43.125, 44.375, 45.625, 46.875, 48.125, 49.375,\n", " 50.625, 51.875, 53.125, 54.375, 55.625, 56.875, 58.125, 59.375,\n", " 60.625, 61.875, 63.125, 64.375, 65.625, 66.875, 68.125, 69.375,\n", " 70.625, 71.875, 73.125, 74.375, 75.625, 76.875, 78.125, 79.375,\n", " 80.625, 81.875, 83.125, 84.375, 85.625, 86.875, 88.125, 89.375])
array([ 0.9375, 2.8125, 4.6875, 6.5625, 8.4375, 10.3125, 12.1875,\n", " 14.0625, 15.9375, 17.8125, 19.6875, 21.5625, 23.4375, 25.3125,\n", " 27.1875, 29.0625, 30.9375, 32.8125, 34.6875, 36.5625, 38.4375,\n", " 40.3125, 42.1875, 44.0625, 45.9375, 47.8125, 49.6875, 51.5625,\n", " 53.4375, 55.3125, 57.1875, 59.0625, 60.9375, 62.8125, 64.6875,\n", " 66.5625, 68.4375, 70.3125, 72.1875, 74.0625, 75.9375, 77.8125,\n", " 79.6875, 81.5625, 83.4375, 85.3125, 87.1875, 89.0625, 90.9375,\n", " 92.8125, 94.6875, 96.5625, 98.4375, 100.3125, 102.1875, 104.0625,\n", " 105.9375, 107.8125, 109.6875, 111.5625, 113.4375, 115.3125, 117.1875,\n", " 119.0625, 120.9375, 122.8125, 124.6875, 126.5625, 128.4375, 130.3125,\n", " 132.1875, 134.0625, 135.9375, 137.8125, 139.6875, 141.5625, 143.4375,\n", " 145.3125, 147.1875, 149.0625, 150.9375, 152.8125, 154.6875, 156.5625,\n", " 158.4375, 160.3125, 162.1875, 164.0625, 165.9375, 167.8125, 169.6875,\n", " 171.5625, 173.4375, 175.3125, 177.1875, 179.0625, 180.9375, 182.8125,\n", " 184.6875, 186.5625, 188.4375, 190.3125, 192.1875, 194.0625, 195.9375,\n", " 197.8125, 199.6875, 201.5625, 203.4375, 205.3125, 207.1875, 209.0625,\n", " 210.9375, 212.8125, 214.6875, 216.5625, 218.4375, 220.3125, 222.1875,\n", " 224.0625, 225.9375, 227.8125, 229.6875, 231.5625, 233.4375, 235.3125,\n", " 237.1875, 239.0625, 240.9375, 242.8125, 244.6875, 246.5625, 248.4375,\n", " 250.3125, 252.1875, 254.0625, 255.9375, 257.8125, 259.6875, 261.5625,\n", " 263.4375, 265.3125, 267.1875, 269.0625, 270.9375, 272.8125, 274.6875,\n", " 276.5625, 278.4375, 280.3125, 282.1875, 284.0625, 285.9375, 287.8125,\n", " 289.6875, 291.5625, 293.4375, 295.3125, 297.1875, 299.0625, 300.9375,\n", " 302.8125, 304.6875, 306.5625, 308.4375, 310.3125, 312.1875, 314.0625,\n", " 315.9375, 317.8125, 319.6875, 321.5625, 323.4375, 325.3125, 327.1875,\n", " 329.0625, 330.9375, 332.8125, 334.6875, 336.5625, 338.4375, 340.3125,\n", " 342.1875, 344.0625, 345.9375, 347.8125, 349.6875, 351.5625, 353.4375,\n", " 355.3125, 357.1875, 359.0625])
array(2.)
<xarray.DataArray 'tas' ()>\n", "array(295.87695312)\n", "Coordinates:\n", " time datetime64[ns] 1850-01-16T12:00:00\n", " lat float64 -26.88\n", " lon float64 186.6\n", " height float64 2.0\n", "Attributes:\n", " standard_name: air_temperature\n", " long_name: Near-Surface Air Temperature\n", " comment: near-surface (usually, 2 meter) air temperature\n", " units: K\n", " cell_methods: area: time: mean\n", " cell_measures: area: areacella\n", " history: 2019-11-08T06:41:45Z altered by CMOR: Treated scalar dime...\n", " _ChunkSizes: [ 1 144 192]
array(295.87695312)
array('1850-01-16T12:00:00.000000000', dtype='datetime64[ns]')
array(-26.875)
array(186.5625)
array(2.)
\n",
"
| \n",
"\n", "\n", " | \n", "
\n",
"Client\n", "
| \n",
"\n",
"Cluster\n", "
| \n",
"