diff --git a/_preview/469/_images/2132334a4e24113c264c7b73d26c7ca8322890e0d098aca0c212ac3a05099efc.png b/_preview/469/_images/2132334a4e24113c264c7b73d26c7ca8322890e0d098aca0c212ac3a05099efc.png new file mode 100644 index 000000000..954924c88 Binary files /dev/null and b/_preview/469/_images/2132334a4e24113c264c7b73d26c7ca8322890e0d098aca0c212ac3a05099efc.png differ diff --git a/_preview/469/_images/47f9024f1062d5ffedece6a60710881d2dcaa07655c6ea9e5220ff6b12090f3d.png b/_preview/469/_images/47f9024f1062d5ffedece6a60710881d2dcaa07655c6ea9e5220ff6b12090f3d.png new file mode 100644 index 000000000..820249e35 Binary files /dev/null and b/_preview/469/_images/47f9024f1062d5ffedece6a60710881d2dcaa07655c6ea9e5220ff6b12090f3d.png differ diff --git a/_preview/469/_images/63c336ba516a50c335f6f506d026535ea2c60c4b6458e054b95cab8634beda40.png b/_preview/469/_images/63c336ba516a50c335f6f506d026535ea2c60c4b6458e054b95cab8634beda40.png new file mode 100644 index 000000000..7c7816643 Binary files /dev/null and b/_preview/469/_images/63c336ba516a50c335f6f506d026535ea2c60c4b6458e054b95cab8634beda40.png differ diff --git a/_preview/469/_images/7cab4a86279c2bbd6b804a7d1e7106b9c6dd9e4d7289a36d04ab40d1d83cc7b6.png b/_preview/469/_images/7cab4a86279c2bbd6b804a7d1e7106b9c6dd9e4d7289a36d04ab40d1d83cc7b6.png new file mode 100644 index 000000000..fffab2773 Binary files /dev/null and b/_preview/469/_images/7cab4a86279c2bbd6b804a7d1e7106b9c6dd9e4d7289a36d04ab40d1d83cc7b6.png differ diff --git a/_preview/469/_images/99bb67ebc86a3b83aa758ba3ca4c13efb4d34a9fee572d99ee2d787d4e553dce.png b/_preview/469/_images/99bb67ebc86a3b83aa758ba3ca4c13efb4d34a9fee572d99ee2d787d4e553dce.png new file mode 100644 index 000000000..4ef9a8e8d Binary files /dev/null and b/_preview/469/_images/99bb67ebc86a3b83aa758ba3ca4c13efb4d34a9fee572d99ee2d787d4e553dce.png differ diff --git a/_preview/469/_images/a648db3a2629e85815e466ef5e59afbb9533919ef45f2dffd6a5d141177d0c5a.png b/_preview/469/_images/a648db3a2629e85815e466ef5e59afbb9533919ef45f2dffd6a5d141177d0c5a.png new file mode 100644 index 000000000..1da491716 Binary files /dev/null and b/_preview/469/_images/a648db3a2629e85815e466ef5e59afbb9533919ef45f2dffd6a5d141177d0c5a.png differ diff --git a/_preview/469/_images/a75f3ba474e4d57105fe3c2cdb9111b3716c368c48feaa67dbaf0068330e50ca.png b/_preview/469/_images/a75f3ba474e4d57105fe3c2cdb9111b3716c368c48feaa67dbaf0068330e50ca.png new file mode 100644 index 000000000..92e543889 Binary files /dev/null and b/_preview/469/_images/a75f3ba474e4d57105fe3c2cdb9111b3716c368c48feaa67dbaf0068330e50ca.png differ diff --git a/_preview/469/_images/c13784f5d3fbf2e7f5bd207f60b1b1de5ed7bf1520fd3e6a779a4689493cd653.png b/_preview/469/_images/c13784f5d3fbf2e7f5bd207f60b1b1de5ed7bf1520fd3e6a779a4689493cd653.png new file mode 100644 index 000000000..a2a18a315 Binary files /dev/null and b/_preview/469/_images/c13784f5d3fbf2e7f5bd207f60b1b1de5ed7bf1520fd3e6a779a4689493cd653.png differ diff --git a/_preview/469/_images/f26c49f0c340b4ab92e459343b4207832f25e3766992e4e05b2539c1d747dcb2.png b/_preview/469/_images/f26c49f0c340b4ab92e459343b4207832f25e3766992e4e05b2539c1d747dcb2.png new file mode 100644 index 000000000..6f7689f2d Binary files /dev/null and b/_preview/469/_images/f26c49f0c340b4ab92e459343b4207832f25e3766992e4e05b2539c1d747dcb2.png differ diff --git a/_preview/469/_sources/foundations/conda.md b/_preview/469/_sources/foundations/conda.md index fec715fa5..5d4174f68 100644 --- a/_preview/469/_sources/foundations/conda.md +++ b/_preview/469/_sources/foundations/conda.md @@ -129,6 +129,6 @@ Conda is a package and environment management system that allows you to quickly - [Linux commands](https://cheatography.com/davechild/cheat-sheets/linux-command-line/) - [Conda documentation](https://docs.conda.io/en/latest/) -- [Conda cheat sheet](https://docs.conda.io/projects/conda/en/latest/_downloads/843d9e0198f2a193a3484886fa28163c/conda-cheatsheet.pdf) +- [Conda cheat sheet](https://docs.conda.io/projects/conda/en/4.6.0/_downloads/52a95608c49671267e40c689e0bc00ca/conda-cheatsheet.pdf) - [Anaconda](https://docs.anaconda.com/anaconda/install/) - [Miniconda](https://docs.conda.io/en/latest/miniconda.html) diff --git a/_preview/469/appendix/template.html b/_preview/469/appendix/template.html index c8cc7fe7e..5b8a15a2b 100644 --- a/_preview/469/appendix/template.html +++ b/_preview/469/appendix/template.html @@ -612,8 +612,8 @@
Each section in your notebook can also contain \(\LaTeX\) equations, enabled through MathJax. In the following example, we illustrate some sample MathJax equations. (Rendering instructions, as well as detailed information about MathJax, can be found in this documentation.)
-<cartopy.mpl.feature_artist.FeatureArtist at 0x7f6388800290>
+<cartopy.mpl.feature_artist.FeatureArtist at 0x7f59bc33b740>
<cartopy.mpl.feature_artist.FeatureArtist at 0x7f63809f8ad0>
+<cartopy.mpl.feature_artist.FeatureArtist at 0x7f59bc375f70>
/tmp/ipykernel_2588/2342439358.py:1: DeprecationWarning: datetime.datetime.utcnow() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.datetime.now(datetime.UTC).
+/tmp/ipykernel_2511/2342439358.py:1: DeprecationWarning: datetime.datetime.utcnow() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.datetime.now(datetime.UTC).
start = datetime.utcnow().replace(hour=22, minute=0, second=0, microsecond=0)
@@ -610,7 +610,7 @@ Creating the file and dimensions
-/tmp/ipykernel_2588/2008125275.py:5: DeprecationWarning: datetime.datetime.utcnow() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.datetime.now(datetime.UTC).
+/tmp/ipykernel_2511/2008125275.py:5: DeprecationWarning: datetime.datetime.utcnow() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.datetime.now(datetime.UTC).
nc.history = str(datetime.utcnow()) + ' Python'
@@ -651,7 +651,7 @@ Creating the file and dimensions
-1715804061.5780733
+1715804423.3455348
@@ -614,7 +614,7 @@ time
-The benchmark took 1.0002062320709229 seconds
+The benchmark took 1.0002317428588867 seconds
@@ -815,8 +815,8 @@ Time Zone Naive Versus Time Zone Aware
-I am time zone naive 2024-05-15 20:14:22.615566.
-I am time zone aware 2024-05-15 20:14:22.615600+00:00.
+I am time zone naive 2024-05-15 20:20:24.383078.
+I am time zone aware 2024-05-15 20:20:24.383111+00:00.
@@ -839,8 +839,8 @@ Full time zone support with the <
-I am time zone naive: 2024-05-15 20:14:22.620300.
-I am time zone aware: 2024-05-15 14:14:22.630866-06:00.
+I am time zone naive: 2024-05-15 20:20:24.387451.
+I am time zone aware: 2024-05-15 14:20:24.398482-06:00.
@@ -862,11 +862,11 @@ Print Time with a Different Time Zone
-The UTC time is May 15, 2024, 8:14PM.
-The 'US/Mountain' time is May 15, 2024, 2:14PM.
+The UTC time is May 15, 2024, 8:20PM.
+The 'US/Mountain' time is May 15, 2024, 2:20PM.
-/tmp/ipykernel_2612/3080495102.py:1: DeprecationWarning: datetime.datetime.utcnow() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.datetime.now(datetime.UTC).
+/tmp/ipykernel_2533/3080495102.py:1: DeprecationWarning: datetime.datetime.utcnow() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.datetime.now(datetime.UTC).
utc = dt.datetime.utcnow().replace(tzinfo=pytz.utc)
diff --git a/_preview/469/core/matplotlib/annotations-colorbars-layouts.html b/_preview/469/core/matplotlib/annotations-colorbars-layouts.html
index 69e773236..db7589f45 100644
--- a/_preview/469/core/matplotlib/annotations-colorbars-layouts.html
+++ b/_preview/469/core/matplotlib/annotations-colorbars-layouts.html
@@ -730,7 +730,7 @@ Basic Colorbars
-
+
We can change which colormap to use by setting the keyword argument cmap = 'colormap_name'
in the plotting function call. This sets the colormap not only for the plot, but for the colorbar as well. In this case, we use the magma
colormap:
@@ -745,7 +745,7 @@ Basic Colorbars
-
+
@@ -764,10 +764,10 @@ Shared Colorbars
-<matplotlib.colorbar.Colorbar at 0x7f3bd037acf0>
+<matplotlib.colorbar.Colorbar at 0x7f3f05c26840>
-
+
You may be wondering why the call to fig.colorbar
uses the argument hist1[3]
. The explanation is as follows: hist1
is a tuple returned by hist2d
, and hist1[3]
contains a matplotlib.collections.QuadMesh
that points to the colormap for the first histogram. To make sure that both histograms are using the same colormap with the same range of values, vmax
is set to 0.18 for both plots. This ensures that both histograms are using colormaps that represent values from 0 (the default for histograms) to 0.18. Because the same data values are used for both plots, it doesn’t matter whether we pass in hist1[3]
or hist2[3]
to fig.colorbar
.
@@ -848,7 +848,7 @@
Custom Colorbars
-
+
@@ -865,7 +865,7 @@ Custom Colorbars
-
+
@@ -902,7 +902,7 @@ Mosaic Subplots
-
+
You’ll notice there is not a colorbar plotted by default. When constructing the colorbar, we need to specify the following:
@@ -930,7 +930,7 @@ Mosaic Subplots
-
+
array([[13.4, 18.6, 9.6],
- [18.6, 9.6, 9. ],
- [ 9.6, 9. , 17.7],
- [ 9. , 17.7, 18.9],
- [17.7, 18.9, 16. ],
- [18.9, 16. , 18.3],
- [16. , 18.3, 22.7],
- [18.3, 22.7, 25.2]])
+array([[27.3, 10.3, 25.5],
+ [10.3, 25.5, 19.3],
+ [25.5, 19.3, 24.8],
+ [19.3, 24.8, 17.6],
+ [24.8, 17.6, 18.2],
+ [17.6, 18.2, 24.3],
+ [18.2, 24.3, 22.4],
+ [24.3, 22.4, 26.1]])
array([[ 13.4, 18.6, 2000. ],
- [ 18.6, 2000. , 9. ],
- [2000. , 9. , 17.7],
- [ 9. , 17.7, 18.9],
- [ 17.7, 18.9, 16. ],
- [ 18.9, 16. , 18.3],
- [ 16. , 18.3, 22.7],
- [ 18.3, 22.7, 25.2]])
+array([[ 27.3, 10.3, 2000. ],
+ [ 10.3, 2000. , 19.3],
+ [2000. , 19.3, 24.8],
+ [ 19.3, 24.8, 17.6],
+ [ 24.8, 17.6, 18.2],
+ [ 17.6, 18.2, 24.3],
+ [ 18.2, 24.3, 22.4],
+ [ 24.3, 22.4, 26.1]])
array([[6, 7, 5, ..., 7, 6, 7],
- [7, 6, 7, ..., 7, 7, 7],
- [7, 7, 7, ..., 6, 8, 7],
+array([[7, 7, 7, ..., 6, 6, 6],
+ [5, 7, 6, ..., 7, 7, 7],
+ [7, 6, 7, ..., 6, 7, 7],
...,
- [7, 6, 6, ..., 8, 8, 7],
- [6, 7, 7, ..., 7, 5, 7],
- [6, 7, 7, ..., 7, 7, 7]])
+ [7, 6, 7, ..., 7, 6, 6],
+ [6, 7, 7, ..., 7, 7, 7],
+ [7, 7, 6, ..., 7, 6, 7]])
array([[775. , 737.5, 812.5, ..., 737.5, 775. , 737.5],
- [737.5, 775. , 737.5, ..., 737.5, 737.5, 737.5],
- [737.5, 737.5, 737.5, ..., 775. , 700. , 737.5],
+array([[737.5, 737.5, 737.5, ..., 775. , 775. , 775. ],
+ [812.5, 737.5, 775. , ..., 737.5, 737.5, 737.5],
+ [737.5, 775. , 737.5, ..., 775. , 737.5, 737.5],
...,
- [737.5, 775. , 775. , ..., 700. , 700. , 737.5],
- [775. , 737.5, 737.5, ..., 737.5, 812.5, 737.5],
- [775. , 737.5, 737.5, ..., 737.5, 737.5, 737.5]])
+ [737.5, 775. , 737.5, ..., 737.5, 775. , 775. ],
+ [775. , 737.5, 737.5, ..., 737.5, 737.5, 737.5],
+ [737.5, 737.5, 775. , ..., 737.5, 775. , 737.5]])
array([[-11.02006574, -15.39073793, -5.52332143, ..., -8.50269148,
- -9.51650345, -8.61185863],
- [ -8.86455499, -8.10451488, -10.70314401, ..., -12.32352392,
- -13.79478923, -12.05621114],
- [ -9.0304711 , -7.98813533, -10.76465621, ..., -8.88330733,
- -13.40957636, -12.27633651],
+array([[-11.30945709, -13.30950638, -8.91172625, ..., -9.23622578,
+ -10.25733406, -11.59151859],
+ [ -5.35679931, -10.215725 , -9.82230787, ..., -9.74594194,
+ -10.18426911, -13.71841054],
+ [ -9.47387578, -6.67506719, -5.04708377, ..., -9.77360955,
+ -9.50864457, -8.57108264],
...,
- [-11.70497609, -9.44607957, -7.99503061, ..., -10.84665035,
- -17.16883503, -8.15202088],
- [ -9.73293976, -12.90670918, -6.18857571, ..., -9.94927784,
- -4.93405623, -11.13110698],
- [ -8.06983933, -11.81048769, -10.56012605, ..., -8.04649128,
- -14.81127037, -7.72338292]])
+ [ -6.43517574, -8.06258415, -9.43323769, ..., -11.65130542,
+ -9.61503225, -10.6434578 ],
+ [-13.44451631, -12.03811827, -12.58467017, ..., -9.31814649,
+ -10.89243121, -8.20274499],
+ [ -8.03807801, -7.58997168, -13.36913286, ..., -11.65776466,
+ -8.02325848, -12.38611754]])
array([[-11.02006574, -15.39073793, -5.52332143, ..., -8.50269148,
- -9.51650345, -8.61185863],
- [ -8.86455499, -8.10451488, -10.70314401, ..., -12.32352392,
- -13.79478923, -12.05621114],
- [ -9.0304711 , -7.98813533, -10.76465621, ..., -8.88330733,
- -13.40957636, -12.27633651],
+array([[-11.30945709, -13.30950638, -8.91172625, ..., -9.23622578,
+ -10.25733406, -11.59151859],
+ [ -5.35679931, -10.215725 , -9.82230787, ..., -9.74594194,
+ -10.18426911, -13.71841054],
+ [ -9.47387578, -6.67506719, -5.04708377, ..., -9.77360955,
+ -9.50864457, -8.57108264],
...,
- [-11.70497609, -9.44607957, -7.99503061, ..., -10.84665035,
- -17.16883503, -8.15202088],
- [ -9.73293976, -12.90670918, -6.18857571, ..., -9.94927784,
- -4.93405623, -11.13110698],
- [ -8.06983933, -11.81048769, -10.56012605, ..., -8.04649128,
- -14.81127037, -7.72338292]])
+ [ -6.43517574, -8.06258415, -9.43323769, ..., -11.65130542,
+ -9.61503225, -10.6434578 ],
+ [-13.44451631, -12.03811827, -12.58467017, ..., -9.31814649,
+ -10.89243121, -8.20274499],
+ [ -8.03807801, -7.58997168, -13.36913286, ..., -11.65776466,
+ -8.02325848, -12.38611754]])
Seri
/tmp/ipykernel_2797/737336773.py:1: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`
+/tmp/ipykernel_2723/737336773.py:1: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`
nino34_series[3]
@@ -1449,7 +1449,7 @@ Extending to the
-/tmp/ipykernel_2797/541596450.py:1: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`
+/tmp/ipykernel_2723/541596450.py:1: FutureWarning: Series.__getitem__ treating keys as positions is deprecated. In a future version, integer keys will always be treated as labels (consistent with DataFrame behavior). To access a value by position, use `ser.iloc[pos]`
df["Nino34"][3]
@@ -3645,7 +3645,7 @@ Resampling
-/tmp/ipykernel_2797/233158901.py:1: FutureWarning: 'Y' is deprecated and will be removed in a future version, please use 'YE' instead.
+/tmp/ipykernel_2723/233158901.py:1: FutureWarning: 'Y' is deprecated and will be removed in a future version, please use 'YE' instead.
df.Nino34.resample('1Y').mean().plot();
diff --git a/_preview/469/core/xarray/computation-masking.html b/_preview/469/core/xarray/computation-masking.html
index 1aee61d74..d9d8ada50 100644
--- a/_preview/469/core/xarray/computation-masking.html
+++ b/_preview/469/core/xarray/computation-masking.html
@@ -943,7 +943,7 @@ Data Setup
@@ -1576,7 +1576,7 @@ Arithmetic Operations
+ dtype='float64', name='lon', length=360))
In addition, there are many other arithmetic operations that can be performed on DataArrays
. In this example, we demonstrate squaring the original Celsius values of our air temperature data:
dim
keyword argument, the aggregation method computes an aggregation along the given dimension. In this next example, we use aggregation to calculate the temporal mean across all spatial data; this is performed by providing the dimension name 'time'
to the dim
keyword argument:
where
with one conditionwhere
+ dtype='float64', name='lon', length=360))
As shown in the previous example, methods like .isel()
and .sel()
return data of a different shape than the original data provided to them. However, .where()
preserves the shape of the original data by masking the values with a Boolean condition. Data values for which the condition is True
are returned identical to the values passed in. On the other hand, data values for which the condition is False
are returned as a preset example value. (This example value defaults to nan
, but can be set to other values as well.)
Before testing .where()
, it is helpful to look at the official documentation. As stated above, the .where()
method takes a Boolean condition. (Boolean conditions use operators such as less-than, greater-than, and equal-to, and return a value of True
or False
.) Most uses of .where()
check whether or not specific data values are less than or greater than a constant value. As stated in the documentation, the data values specified in the Boolean condition of .where()
can be any of the following:
where- cell_measures :
- area: areacello
- cell_methods :
- area: mean where sea time: mean
- comment :
- Model data on the 1x1 grid includes values in all cells for which ocean cells on the native grid cover more than 52.5 percent of the 1x1 grid cell. This 52.5 percent cutoff was chosen to produce ocean surface area on the 1x1 grid as close as possible to ocean surface area on the native grid, while not introducing fractional cell coverage.
- description :
- This may differ from "surface temperature" in regions of sea ice or floating ice shelves. For models using conservative temperature as the prognostic field, they should report the top ocean layer as surface potential temperature, which is the same as surface in situ temperature.
- frequency :
- mon
- id :
- tos
- long_name :
- Sea Surface Temperature
- mipTable :
- Omon
- out_name :
- tos
- prov :
- Omon ((isd.003))
- realm :
- ocean
- standard_name :
- sea_surface_temperature
- time :
- time
- time_label :
- time-mean
- time_title :
- Temporal mean
- title :
- Sea Surface Temperature
- type :
- real
- units :
- degC
- variable_id :
- tos
In this example, we use Matplotlib to plot the original, unmasked data, as well as the masked data created in the previous example.
diff --git a/_preview/469/core/xarray/dask-arrays-xarray.html b/_preview/469/core/xarray/dask-arrays-xarray.html
index e54b9efbf..1c8ca3376 100644
--- a/_preview/469/core/xarray/dask-arrays-xarray.html
+++ b/_preview/469/core/xarray/dask-arrays-xarray.html
@@ -568,91 +568,91 @@ Create a dask.a
-array([[[0.42619585, 0.3460787 , 0.70212984, ..., 0.48105343,
- 0.68892914, 0.61161118],
- [0.60714903, 0.21387138, 0.31264833, ..., 0.41828523,
- 0.36530337, 0.11563184],
- [0.80690735, 0.48943936, 0.12829131, ..., 0.71241428,
- 0.10929086, 0.49277564],
+array([[[0.50129255, 0.12170979, 0.4823771 , ..., 0.1171057 ,
+ 0.45503716, 0.07804539],
+ [0.48194159, 0.96575481, 0.48930575, ..., 0.48938636,
+ 0.88043439, 0.9713421 ],
+ [0.87146974, 0.6794744 , 0.09736247, ..., 0.85600927,
+ 0.39258694, 0.0934675 ],
...,
- [0.79437761, 0.86203153, 0.27549624, ..., 0.36676001,
- 0.72596153, 0.47562752],
- [0.99318622, 0.41793571, 0.84353615, ..., 0.79432612,
- 0.79933505, 0.34578859],
- [0.6297163 , 0.21976961, 0.07774188, ..., 0.24356169,
- 0.73588426, 0.67582006]],
-
- [[0.14075869, 0.36484711, 0.70363903, ..., 0.84024515,
- 0.96586779, 0.27715433],
- [0.19058993, 0.45925603, 0.30252367, ..., 0.20554363,
- 0.16240525, 0.72766255],
- [0.74412481, 0.56040744, 0.62414631, ..., 0.11383181,
- 0.54231686, 0.22334335],
+ [0.35123015, 0.94305833, 0.63955098, ..., 0.515642 ,
+ 0.5916941 , 0.71237481],
+ [0.81589098, 0.08791992, 0.43822532, ..., 0.96868279,
+ 0.3014953 , 0.14146411],
+ [0.65072238, 0.88178701, 0.72214194, ..., 0.14991292,
+ 0.12428558, 0.71978217]],
+
+ [[0.2945843 , 0.58190069, 0.06567647, ..., 0.10771692,
+ 0.4656152 , 0.87549448],
+ [0.66203288, 0.25977193, 0.59163841, ..., 0.42418254,
+ 0.513806 , 0.67740073],
+ [0.99307403, 0.66818184, 0.82612966, ..., 0.47637769,
+ 0.66800734, 0.06002842],
...,
- [0.88422507, 0.45308131, 0.77458962, ..., 0.68637992,
- 0.11265889, 0.43630416],
- [0.21112711, 0.25631919, 0.37390342, ..., 0.43258578,
- 0.43820432, 0.28678117],
- [0.6278334 , 0.37738011, 0.92017037, ..., 0.9450499 ,
- 0.38574193, 0.66003659]],
-
- [[0.24615892, 0.70447701, 0.20479162, ..., 0.13018228,
- 0.63449086, 0.13711861],
- [0.17568184, 0.56132821, 0.4603529 , ..., 0.5996156 ,
- 0.74353839, 0.35994547],
- [0.67880917, 0.35877394, 0.06871422, ..., 0.27812217,
- 0.55220094, 0.47480306],
+ [0.35584311, 0.9401825 , 0.93194724, ..., 0.59611877,
+ 0.02216099, 0.86972338],
+ [0.49672944, 0.13113269, 0.95823488, ..., 0.25836428,
+ 0.8646987 , 0.67833181],
+ [0.56935623, 0.99929225, 0.79268213, ..., 0.26782241,
+ 0.86166941, 0.15650059]],
+
+ [[0.59137874, 0.59546995, 0.03759033, ..., 0.838337 ,
+ 0.20889574, 0.42644245],
+ [0.23324162, 0.34029668, 0.96497438, ..., 0.21990532,
+ 0.27924336, 0.76667751],
+ [0.78420866, 0.16506527, 0.77192297, ..., 0.6114422 ,
+ 0.76322341, 0.61931358],
...,
- [0.22274867, 0.33590431, 0.97711209, ..., 0.9144557 ,
- 0.26473722, 0.80258083],
- [0.71261017, 0.42653901, 0.83356844, ..., 0.17961502,
- 0.9276977 , 0.23783074],
- [0.41089129, 0.95130338, 0.86978586, ..., 0.9140639 ,
- 0.15353737, 0.01253671]],
+ [0.74233335, 0.71062548, 0.08062059, ..., 0.38670771,
+ 0.78420202, 0.88637306],
+ [0.63585926, 0.50219253, 0.87121342, ..., 0.58678452,
+ 0.33564125, 0.67089288],
+ [0.8276186 , 0.21154281, 0.01396797, ..., 0.95112473,
+ 0.42799596, 0.5517961 ]],
...,
- [[0.67903025, 0.17489637, 0.08324747, ..., 0.33922201,
- 0.63953105, 0.26750945],
- [0.98153673, 0.56552277, 0.96594569, ..., 0.84674109,
- 0.39312139, 0.15294754],
- [0.24752702, 0.9459115 , 0.07983537, ..., 0.49408528,
- 0.16383513, 0.50539386],
+ [[0.36548177, 0.8124403 , 0.98302885, ..., 0.16221743,
+ 0.31696554, 0.05521503],
+ [0.21044976, 0.49266523, 0.82979493, ..., 0.76736092,
+ 0.77400551, 0.02562802],
+ [0.37917563, 0.67170857, 0.82232536, ..., 0.53168069,
+ 0.78606023, 0.38887112],
...,
- [0.87801373, 0.97310603, 0.47329974, ..., 0.44647724,
- 0.274614 , 0.3340663 ],
- [0.46119499, 0.4050515 , 0.26859605, ..., 0.05971933,
- 0.70586876, 0.65798148],
- [0.18646554, 0.06725249, 0.28496924, ..., 0.97594642,
- 0.00710785, 0.88032036]],
-
- [[0.58650894, 0.35310113, 0.90393813, ..., 0.28316129,
- 0.36489762, 0.86573707],
- [0.01697008, 0.25901842, 0.49447514, ..., 0.13938943,
- 0.32705863, 0.27436511],
- [0.69975508, 0.33497713, 0.95225859, ..., 0.22648317,
- 0.00186771, 0.41287448],
+ [0.61131742, 0.39183678, 0.58678986, ..., 0.12118291,
+ 0.88815621, 0.30250744],
+ [0.18190165, 0.49205168, 0.93850341, ..., 0.84258232,
+ 0.12207021, 0.08583647],
+ [0.31806248, 0.33154385, 0.40594319, ..., 0.44955817,
+ 0.2446685 , 0.75114996]],
+
+ [[0.37252423, 0.83874324, 0.40274604, ..., 0.27167212,
+ 0.64681993, 0.04431818],
+ [0.94896414, 0.16955608, 0.04567061, ..., 0.21889054,
+ 0.50111575, 0.91115928],
+ [0.07953844, 0.40079749, 0.85497659, ..., 0.55662617,
+ 0.11984294, 0.49493556],
...,
- [0.94575658, 0.42493895, 0.13350709, ..., 0.80746073,
- 0.3605811 , 0.59630113],
- [0.48763946, 0.36949871, 0.11096313, ..., 0.25782538,
- 0.35392457, 0.20190832],
- [0.37260902, 0.69682549, 0.17793745, ..., 0.87804855,
- 0.92775986, 0.92836787]],
-
- [[0.88785624, 0.63056509, 0.85095943, ..., 0.70954772,
- 0.74707012, 0.14563673],
- [0.52718367, 0.80369536, 0.97749093, ..., 0.47084097,
- 0.75500911, 0.73108591],
- [0.20517313, 0.31264406, 0.19515458, ..., 0.3887044 ,
- 0.17821843, 0.73959291],
+ [0.20769167, 0.67627594, 0.545316 , ..., 0.19526661,
+ 0.01273605, 0.75151812],
+ [0.0938911 , 0.78829473, 0.16116177, ..., 0.87163685,
+ 0.00636033, 0.84051121],
+ [0.12142223, 0.11751318, 0.40008057, ..., 0.51826842,
+ 0.79502155, 0.79471742]],
+
+ [[0.03393967, 0.14304421, 0.58478203, ..., 0.33549936,
+ 0.172149 , 0.24527774],
+ [0.60344338, 0.44849003, 0.2743809 , ..., 0.39053084,
+ 0.04644772, 0.3881293 ],
+ [0.08313059, 0.13929276, 0.69234803, ..., 0.04451855,
+ 0.22467704, 0.66854978],
...,
- [0.32597474, 0.02341073, 0.86163965, ..., 0.86879983,
- 0.61371226, 0.41784847],
- [0.16944696, 0.99562056, 0.3013229 , ..., 0.10752478,
- 0.82700023, 0.91398824],
- [0.70175585, 0.75304761, 0.5102735 , ..., 0.69517215,
- 0.21953989, 0.46159043]]])
+ [0.82708562, 0.86163999, 0.04971098, ..., 0.79550766,
+ 0.39569401, 0.76924608],
+ [0.75823461, 0.65411879, 0.43274064, ..., 0.77002936,
+ 0.13612392, 0.20823894],
+ [0.68794281, 0.62137479, 0.89932778, ..., 0.14320067,
+ 0.35456247, 0.85885081]]])
@@ -872,11 +872,11 @@ Compute the result
-CPU times: user 403 ms, sys: 28.6 ms, total: 431 ms
-Wall time: 245 ms
+CPU times: user 395 ms, sys: 32.3 ms, total: 427 ms
+Wall time: 226 ms
-12000065.34764746
+12000727.753660701
@@ -974,7 +974,7 @@ Exercise with d
-
+
@@ -1106,7 +1106,7 @@ Testing a bigger calculation
-
+
@@ -1117,37 +1117,37 @@ Testing a bigger calculation
-[ ] | 0% Completed | 338.16 us
+[ ] | 0% Completed | 299.99 us
-[ ] | 0% Completed | 108.25 ms
+[ ] | 0% Completed | 107.03 ms
-[ ] | 0% Completed | 208.96 ms
+[ ] | 0% Completed | 208.00 ms
-[ ] | 0% Completed | 310.02 ms
+[ ] | 0% Completed | 308.76 ms
-[ ] | 0% Completed | 410.67 ms
+[ ] | 0% Completed | 409.55 ms
-[ ] | 0% Completed | 511.48 ms
+[ ] | 0% Completed | 510.24 ms
-[ ] | 1% Completed | 612.13 ms
+[ ] | 2% Completed | 610.89 ms
-[# ] | 3% Completed | 713.13 ms
+[# ] | 4% Completed | 711.75 ms
-[## ] | 6% Completed | 814.11 ms
+[### ] | 7% Completed | 812.83 ms
-[#### ] | 10% Completed | 915.14 ms
+[#### ] | 10% Completed | 913.79 ms
-[#### ] | 10% Completed | 1.02 s
+[#### ] | 10% Completed | 1.01 s
[#### ] | 10% Completed | 1.12 s
@@ -1162,13 +1162,13 @@ Testing a bigger calculation[#### ] | 10% Completed | 1.42 s
-[##### ] | 12% Completed | 1.52 s
+[##### ] | 14% Completed | 1.52 s
-[###### ] | 15% Completed | 1.62 s
+[###### ] | 17% Completed | 1.62 s
-[####### ] | 19% Completed | 1.72 s
+[######## ] | 20% Completed | 1.72 s
[######## ] | 21% Completed | 1.82 s
@@ -1186,160 +1186,154 @@ Testing a bigger calculation[######## ] | 21% Completed | 2.22 s
-[######## ] | 21% Completed | 2.33 s
+[######### ] | 23% Completed | 2.33 s
-[######### ] | 24% Completed | 2.43 s
+[########## ] | 25% Completed | 2.43 s
-[########## ] | 26% Completed | 2.53 s
+[########### ] | 28% Completed | 2.53 s
-[############ ] | 30% Completed | 2.63 s
+[############# ] | 33% Completed | 2.63 s
-[############# ] | 33% Completed | 2.73 s
+[############# ] | 34% Completed | 2.74 s
-[############# ] | 34% Completed | 2.83 s
+[############# ] | 34% Completed | 2.84 s
-[############# ] | 34% Completed | 2.93 s
+[############# ] | 34% Completed | 2.94 s
-[############# ] | 34% Completed | 3.03 s
+[############# ] | 34% Completed | 3.04 s
-[############# ] | 34% Completed | 3.13 s
+[############# ] | 34% Completed | 3.14 s
-[############# ] | 34% Completed | 3.23 s
+[############## ] | 35% Completed | 3.24 s
-[############## ] | 36% Completed | 3.33 s
+[############### ] | 38% Completed | 3.34 s
-[############### ] | 38% Completed | 3.43 s
+[################ ] | 41% Completed | 3.44 s
-[################ ] | 42% Completed | 3.54 s
+[################## ] | 45% Completed | 3.55 s
-[################## ] | 45% Completed | 3.64 s
+[################### ] | 48% Completed | 3.65 s
-[################### ] | 48% Completed | 3.74 s
+[################### ] | 48% Completed | 3.75 s
-[################### ] | 48% Completed | 3.84 s
+[################### ] | 48% Completed | 3.85 s
-[################### ] | 48% Completed | 3.94 s
+[################### ] | 48% Completed | 3.95 s
-[################### ] | 48% Completed | 4.04 s
+[################### ] | 48% Completed | 4.05 s
-[################### ] | 48% Completed | 4.14 s
+[################### ] | 48% Completed | 4.15 s
-[################### ] | 48% Completed | 4.24 s
+[#################### ] | 51% Completed | 4.25 s
-[#################### ] | 51% Completed | 4.34 s
+[###################### ] | 55% Completed | 4.36 s
-[##################### ] | 53% Completed | 4.44 s
+[####################### ] | 57% Completed | 4.46 s
-[####################### ] | 57% Completed | 4.54 s
+[####################### ] | 59% Completed | 4.56 s
-[####################### ] | 59% Completed | 4.64 s
+[####################### ] | 59% Completed | 4.66 s
-[####################### ] | 59% Completed | 4.75 s
+[####################### ] | 59% Completed | 4.76 s
-[####################### ] | 59% Completed | 4.85 s
+[####################### ] | 59% Completed | 4.86 s
-[####################### ] | 59% Completed | 4.95 s
+[####################### ] | 59% Completed | 4.96 s
-[####################### ] | 59% Completed | 5.05 s
+[######################## ] | 60% Completed | 5.06 s
-[######################## ] | 60% Completed | 5.15 s
+[######################### ] | 63% Completed | 5.16 s
-[######################### ] | 62% Completed | 5.25 s
+[########################## ] | 66% Completed | 5.26 s
-[########################## ] | 66% Completed | 5.35 s
+[############################ ] | 71% Completed | 5.36 s
-[########################### ] | 69% Completed | 5.45 s
+[############################# ] | 74% Completed | 5.46 s
-[############################# ] | 73% Completed | 5.55 s
+[############################# ] | 74% Completed | 5.57 s
-[############################# ] | 74% Completed | 5.65 s
+[############################# ] | 74% Completed | 5.67 s
-[############################# ] | 74% Completed | 5.75 s
+[############################# ] | 74% Completed | 5.77 s
-[############################# ] | 74% Completed | 5.85 s
+[############################# ] | 74% Completed | 5.87 s
-[############################# ] | 74% Completed | 5.95 s
+[############################# ] | 74% Completed | 5.97 s
-[############################# ] | 74% Completed | 6.06 s
+[############################## ] | 77% Completed | 6.07 s
-[############################## ] | 76% Completed | 6.16 s
+[################################ ] | 80% Completed | 6.17 s
-[############################### ] | 79% Completed | 6.26 s
+[################################# ] | 84% Completed | 6.27 s
-[################################# ] | 82% Completed | 6.36 s
+[################################## ] | 85% Completed | 6.37 s
-[################################# ] | 84% Completed | 6.46 s
+[################################## ] | 85% Completed | 6.47 s
-[################################## ] | 85% Completed | 6.56 s
+[################################## ] | 85% Completed | 6.57 s
-[################################## ] | 85% Completed | 6.66 s
+[################################## ] | 85% Completed | 6.68 s
-[################################## ] | 85% Completed | 6.76 s
+[################################## ] | 85% Completed | 6.78 s
-[################################## ] | 85% Completed | 6.86 s
+[################################## ] | 86% Completed | 6.88 s
-[################################## ] | 86% Completed | 6.96 s
+[################################### ] | 89% Completed | 6.98 s
-[################################### ] | 89% Completed | 7.06 s
+[##################################### ] | 94% Completed | 7.08 s
-[#################################### ] | 91% Completed | 7.16 s
+[###################################### ] | 96% Completed | 7.19 s
-[###################################### ] | 96% Completed | 7.26 s
-
-
-[####################################### ] | 98% Completed | 7.37 s
-
-
-[########################################] | 100% Completed | 7.47 s
+[########################################] | 100% Completed | 7.29 s
@@ -1857,7 +1851,7 @@ Reading data with
- latPandasIndex
PandasIndex(Index([-89.5, -88.5, -87.5, -86.5, -85.5, -84.5, -83.5, -82.5, -81.5, -80.5,
+ 80.5, 81.5, 82.5, 83.5, 84.5, 85.5, 86.5, 87.5, 88.5, 89.5])
- lon(lon)float640.5 1.5 2.5 ... 357.5 358.5 359.5
array([ 0.5, 1.5, 2.5, ..., 357.5, 358.5, 359.5])
- latPandasIndex
PandasIndex(Index([-89.5, -88.5, -87.5, -86.5, -85.5, -84.5, -83.5, -82.5, -81.5, -80.5,
...
80.5, 81.5, 82.5, 83.5, 84.5, 85.5, 86.5, 87.5, 88.5, 89.5],
- dtype='float64', name='lat', length=180))
- lonPandasIndex
PandasIndex(Index([ 0.5, 1.5, 2.5, 3.5, 4.5, 5.5, 6.5, 7.5, 8.5, 9.5,
+ dtype='float64', name='lat', length=180))
- lonPandasIndex
PandasIndex(Index([ 0.5, 1.5, 2.5, 3.5, 4.5, 5.5, 6.5, 7.5, 8.5, 9.5,
...
350.5, 351.5, 352.5, 353.5, 354.5, 355.5, 356.5, 357.5, 358.5, 359.5],
- dtype='float64', name='lon', length=360))
+ dtype='float64', name='lon', length=360))
As shown in the above example, the result of the applied operations is an Xarray DataArray
that contains a Dask Array, an identical object type to the object that the operations were performed on. This is true for any operations that can be applied to Xarray DataArrays
, including subsetting operations; this next example illustrates this:
@@ -3742,7 +3736,7 @@ Parallel and lazy computation using
@@ -3797,10 +3791,10 @@ Parallel and lazy computation using dask.visualize()
function, as shown in this example:
@@ -3822,10 +3816,10 @@ Parallel and lazy computation using
-[ ] | 0% Completed | 129.02 us
+[ ] | 0% Completed | 127.07 us
-[########################################] | 100% Completed | 101.17 ms
+[########################################] | 100% Completed | 101.39 ms
diff --git a/_preview/469/core/xarray/enso-xarray.html b/_preview/469/core/xarray/enso-xarray.html
index 32ddcb63d..012e29118 100644
--- a/_preview/469/core/xarray/enso-xarray.html
+++ b/_preview/469/core/xarray/enso-xarray.html
@@ -958,7 +958,7 @@ The Niño 3.4 Index
@@ -1590,7 +1590,7 @@ Select the Niño 3.4 regionwhere() method:
+array(1.8436452, dtype=float32)
The final step of the Niño 3.4 index calculation involves normalizing the data. In this example, we perform this normalization by dividing the smoothed anomaly data by the standard deviation calculated above:
diff --git a/_preview/469/core/xarray/xarray-intro.html b/_preview/469/core/xarray/xarray-intro.html
index b5942df1d..369876cb3 100644
--- a/_preview/469/core/xarray/xarray-intro.html
+++ b/_preview/469/core/xarray/xarray-intro.html
@@ -583,25 +583,25 @@ Generate a random numpy array
-array([[[273.80442217, 289.87496223, 283.43025556, 279.52287757],
- [290.42309981, 281.464434 , 287.40603837, 278.43287441],
- [282.62005989, 292.38893315, 288.19165787, 283.35910849]],
+array([[[289.44705173, 288.57153159, 275.44047043, 294.25838396],
+ [287.85161575, 283.50611783, 277.53595954, 279.06417585],
+ [286.12350092, 273.21540816, 277.66062654, 280.28457805]],
- [[287.8422476 , 281.86675526, 281.66114533, 286.51895117],
- [274.72806155, 279.52345451, 280.4543508 , 284.10403691],
- [282.79579667, 286.43994545, 275.587234 , 292.30626036]],
+ [[295.03260826, 279.59313303, 290.98832877, 279.77499799],
+ [278.95918871, 272.71420309, 287.82516859, 278.99590275],
+ [283.80477841, 291.16324141, 276.13038116, 283.905546 ]],
- [[280.49928862, 276.18696897, 279.02877455, 280.06627735],
- [279.6443178 , 285.98499909, 279.87552066, 275.67146669],
- [291.20774029, 283.25765874, 283.6759564 , 274.68438846]],
+ [[289.3198786 , 271.32639859, 286.92079794, 294.56036398],
+ [282.54834705, 280.54989636, 274.87552029, 280.56905816],
+ [292.25692774, 269.05323758, 286.37231473, 281.75710318]],
- [[283.37776298, 284.59586384, 283.27852928, 287.67374542],
- [282.3938179 , 278.58383709, 277.52597722, 279.40061209],
- [283.87371819, 293.89142085, 294.98215092, 282.8231519 ]],
+ [[274.77795265, 281.41918854, 281.85682779, 279.88194864],
+ [296.47598817, 286.58650518, 285.29480791, 275.58603747],
+ [284.04359783, 286.26999408, 275.64153335, 279.19894639]],
- [[288.12378065, 286.20004961, 271.76515987, 286.68613421],
- [281.49914175, 271.89767102, 278.9359245 , 281.18729189],
- [279.86577066, 278.41230452, 289.89084998, 283.11860462]]])
+ [[292.10654386, 281.09526564, 291.18475062, 281.27542066],
+ [276.52719491, 280.14139858, 276.34463485, 284.29537389],
+ [281.36781571, 275.64069397, 284.71280549, 278.71279454]]])
@@ -982,44 +982,44 @@ Wrap the array: first attempt
@@ -1402,44 +1402,44 @@ Assign dimension names<xarray.DataArray (time: 5, lat: 3, lon: 4)> Size: 480B
-array([[[273.80442217, 289.87496223, 283.43025556, 279.52287757],
- [290.42309981, 281.464434 , 287.40603837, 278.43287441],
- [282.62005989, 292.38893315, 288.19165787, 283.35910849]],
-
- [[287.8422476 , 281.86675526, 281.66114533, 286.51895117],
- [274.72806155, 279.52345451, 280.4543508 , 284.10403691],
- [282.79579667, 286.43994545, 275.587234 , 292.30626036]],
-
- [[280.49928862, 276.18696897, 279.02877455, 280.06627735],
- [279.6443178 , 285.98499909, 279.87552066, 275.67146669],
- [291.20774029, 283.25765874, 283.6759564 , 274.68438846]],
-
- [[283.37776298, 284.59586384, 283.27852928, 287.67374542],
- [282.3938179 , 278.58383709, 277.52597722, 279.40061209],
- [283.87371819, 293.89142085, 294.98215092, 282.8231519 ]],
-
- [[288.12378065, 286.20004961, 271.76515987, 286.68613421],
- [281.49914175, 271.89767102, 278.9359245 , 281.18729189],
- [279.86577066, 278.41230452, 289.89084998, 283.11860462]]])
-Dimensions without coordinates: time, lat, lon
+array([[[289.44705173, 288.57153159, 275.44047043, 294.25838396],
+ [287.85161575, 283.50611783, 277.53595954, 279.06417585],
+ [286.12350092, 273.21540816, 277.66062654, 280.28457805]],
+
+ [[295.03260826, 279.59313303, 290.98832877, 279.77499799],
+ [278.95918871, 272.71420309, 287.82516859, 278.99590275],
+ [283.80477841, 291.16324141, 276.13038116, 283.905546 ]],
+
+ [[289.3198786 , 271.32639859, 286.92079794, 294.56036398],
+ [282.54834705, 280.54989636, 274.87552029, 280.56905816],
+ [292.25692774, 269.05323758, 286.37231473, 281.75710318]],
+
+ [[274.77795265, 281.41918854, 281.85682779, 279.88194864],
+ [296.47598817, 286.58650518, 285.29480791, 275.58603747],
+ [284.04359783, 286.26999408, 275.64153335, 279.19894639]],
+
+ [[292.10654386, 281.09526564, 291.18475062, 281.27542066],
+ [276.52719491, 280.14139858, 276.34463485, 284.29537389],
+ [281.36781571, 275.64069397, 284.71280549, 278.71279454]]])
+Dimensions without coordinates: time, lat, lon
This DataArray
is already an improvement over a NumPy array; the DataArray
contains names for each of the dimensions (or axes in NumPy parlance). An additional improvement is the association of coordinate-value arrays with data upon creation of a DataArray
. In the next example, we illustrate the creation of NumPy arrays representing the coordinate values for each dimension of the DataArray
, and how to associate these coordinate arrays with the data in our DataArray
.
@@ -1849,51 +1849,51 @@ Initialize the
fill: currentColor;
}
<xarray.DataArray (time: 5, lat: 3, lon: 4)> Size: 480B
-array([[[273.80442217, 289.87496223, 283.43025556, 279.52287757],
- [290.42309981, 281.464434 , 287.40603837, 278.43287441],
- [282.62005989, 292.38893315, 288.19165787, 283.35910849]],
+array([[[289.44705173, 288.57153159, 275.44047043, 294.25838396],
+ [287.85161575, 283.50611783, 277.53595954, 279.06417585],
+ [286.12350092, 273.21540816, 277.66062654, 280.28457805]],
- [[287.8422476 , 281.86675526, 281.66114533, 286.51895117],
- [274.72806155, 279.52345451, 280.4543508 , 284.10403691],
- [282.79579667, 286.43994545, 275.587234 , 292.30626036]],
+ [[295.03260826, 279.59313303, 290.98832877, 279.77499799],
+ [278.95918871, 272.71420309, 287.82516859, 278.99590275],
+ [283.80477841, 291.16324141, 276.13038116, 283.905546 ]],
- [[280.49928862, 276.18696897, 279.02877455, 280.06627735],
- [279.6443178 , 285.98499909, 279.87552066, 275.67146669],
- [291.20774029, 283.25765874, 283.6759564 , 274.68438846]],
+ [[289.3198786 , 271.32639859, 286.92079794, 294.56036398],
+ [282.54834705, 280.54989636, 274.87552029, 280.56905816],
+ [292.25692774, 269.05323758, 286.37231473, 281.75710318]],
- [[283.37776298, 284.59586384, 283.27852928, 287.67374542],
- [282.3938179 , 278.58383709, 277.52597722, 279.40061209],
- [283.87371819, 293.89142085, 294.98215092, 282.8231519 ]],
+ [[274.77795265, 281.41918854, 281.85682779, 279.88194864],
+ [296.47598817, 286.58650518, 285.29480791, 275.58603747],
+ [284.04359783, 286.26999408, 275.64153335, 279.19894639]],
- [[288.12378065, 286.20004961, 271.76515987, 286.68613421],
- [281.49914175, 271.89767102, 278.9359245 , 281.18729189],
- [279.86577066, 278.41230452, 289.89084998, 283.11860462]]])
+ [[292.10654386, 281.09526564, 291.18475062, 281.27542066],
+ [276.52719491, 280.14139858, 276.34463485, 284.29537389],
+ [281.36781571, 275.64069397, 284.71280549, 278.71279454]]])
Coordinates:
* time (time) datetime64[ns] 40B 2018-01-01 2018-01-02 ... 2018-01-05
* lat (lat) float64 24B 25.0 40.0 55.0
- * lon (lon) float64 32B -120.0 -100.0 -80.0 -60.0
+ dtype='datetime64[ns]', name='time', freq='D'))
latPandasIndexPandasIndex(Index([25.0, 40.0, 55.0], dtype='float64', name='lat'))
lonPandasIndexPandasIndex(Index([-120.0, -100.0, -80.0, -60.0], dtype='float64', name='lon'))
@@ -2273,54 +2273,54 @@ Set useful attributes<xarray.DataArray (time: 5, lat: 3, lon: 4)> Size: 480B
-array([[[273.80442217, 289.87496223, 283.43025556, 279.52287757],
- [290.42309981, 281.464434 , 287.40603837, 278.43287441],
- [282.62005989, 292.38893315, 288.19165787, 283.35910849]],
+array([[[289.44705173, 288.57153159, 275.44047043, 294.25838396],
+ [287.85161575, 283.50611783, 277.53595954, 279.06417585],
+ [286.12350092, 273.21540816, 277.66062654, 280.28457805]],
- [[287.8422476 , 281.86675526, 281.66114533, 286.51895117],
- [274.72806155, 279.52345451, 280.4543508 , 284.10403691],
- [282.79579667, 286.43994545, 275.587234 , 292.30626036]],
+ [[295.03260826, 279.59313303, 290.98832877, 279.77499799],
+ [278.95918871, 272.71420309, 287.82516859, 278.99590275],
+ [283.80477841, 291.16324141, 276.13038116, 283.905546 ]],
- [[280.49928862, 276.18696897, 279.02877455, 280.06627735],
- [279.6443178 , 285.98499909, 279.87552066, 275.67146669],
- [291.20774029, 283.25765874, 283.6759564 , 274.68438846]],
+ [[289.3198786 , 271.32639859, 286.92079794, 294.56036398],
+ [282.54834705, 280.54989636, 274.87552029, 280.56905816],
+ [292.25692774, 269.05323758, 286.37231473, 281.75710318]],
- [[283.37776298, 284.59586384, 283.27852928, 287.67374542],
- [282.3938179 , 278.58383709, 277.52597722, 279.40061209],
- [283.87371819, 293.89142085, 294.98215092, 282.8231519 ]],
+ [[274.77795265, 281.41918854, 281.85682779, 279.88194864],
+ [296.47598817, 286.58650518, 285.29480791, 275.58603747],
+ [284.04359783, 286.26999408, 275.64153335, 279.19894639]],
- [[288.12378065, 286.20004961, 271.76515987, 286.68613421],
- [281.49914175, 271.89767102, 278.9359245 , 281.18729189],
- [279.86577066, 278.41230452, 289.89084998, 283.11860462]]])
+ [[292.10654386, 281.09526564, 291.18475062, 281.27542066],
+ [276.52719491, 280.14139858, 276.34463485, 284.29537389],
+ [281.36781571, 275.64069397, 284.71280549, 278.71279454]]])
Coordinates:
* time (time) datetime64[ns] 40B 2018-01-01 2018-01-02 ... 2018-01-05
* lat (lat) float64 24B 25.0 40.0 55.0
* lon (lon) float64 32B -120.0 -100.0 -80.0 -60.0
Attributes:
units: kelvin
- standard_name: air_temperature
+ dtype='datetime64[ns]', name='time', freq='D'))
latPandasIndexPandasIndex(Index([25.0, 40.0, 55.0], dtype='float64', name='lat'))
lonPandasIndexPandasIndex(Index([-120.0, -100.0, -80.0, -60.0], dtype='float64', name='lon'))
- units :
- kelvin
- standard_name :
- air_temperature
@@ -2699,51 +2699,51 @@ Issues with preservation of attributesdocumentation page.
@@ -3134,54 +3134,54 @@ Create a pressure
latPandasIndexPandasIndex(Index([25.0, 40.0, 55.0], dtype='float64', name='lat'))
lonPandasIndexPandasIndex(Index([-120.0, -100.0, -80.0, -60.0], dtype='float64', name='lon'))
As listed in the rich display above, the new Dataset
object is aware that both DataArrays
share the same coordinate axes. (Please note that if this page is not run as a Jupyter Notebook, the rich display may be unavailable.)
@@ -3986,54 +3986,54 @@ Access Data variables and Coordinates in a DataArrays
through a dictionary syntax, as shown in this example:
@@ -4407,54 +4407,54 @@ Access Data variables and Coordinates in a Dataset
objects are mainly used for loading data from files, which will be covered later in this tutorial.
@@ -4838,18 +4838,18 @@ NumPy-like selection<xarray.DataArray (lat: 3, lon: 4)> Size: 96B
-array([[287.8422476 , 281.86675526, 281.66114533, 286.51895117],
- [274.72806155, 279.52345451, 280.4543508 , 284.10403691],
- [282.79579667, 286.43994545, 275.587234 , 292.30626036]])
+array([[295.03260826, 279.59313303, 290.98832877, 279.77499799],
+ [278.95918871, 272.71420309, 287.82516859, 278.99590275],
+ [283.80477841, 291.16324141, 276.13038116, 283.905546 ]])
Coordinates:
time datetime64[ns] 8B 2018-01-02
* lat (lat) float64 24B 25.0 40.0 55.0
* lon (lon) float64 32B -120.0 -100.0 -80.0 -60.0
Attributes:
units: kelvin
- standard_name: air_temperature
+ standard_name: air_temperature
This example reveals one of the major shortcomings of index selection. In order to retrieve the correct data using index selection, anyone using a DataArray
must have precise knowledge of the axes in the DataArray
, including the order of the axes and the meaning of their indices.
By using named coordinates, as shown in the next set of examples, we can avoid this cumbersome burden.
@@ -5229,18 +5229,18 @@ Selecting with
fill: currentColor;
}
<xarray.DataArray (lat: 3, lon: 4)> Size: 96B
-array([[287.8422476 , 281.86675526, 281.66114533, 286.51895117],
- [274.72806155, 279.52345451, 280.4543508 , 284.10403691],
- [282.79579667, 286.43994545, 275.587234 , 292.30626036]])
+array([[295.03260826, 279.59313303, 290.98832877, 279.77499799],
+ [278.95918871, 272.71420309, 287.82516859, 278.99590275],
+ [283.80477841, 291.16324141, 276.13038116, 283.905546 ]])
Coordinates:
time datetime64[ns] 8B 2018-01-02
* lat (lat) float64 24B 25.0 40.0 55.0
* lon (lon) float64 32B -120.0 -100.0 -80.0 -60.0
Attributes:
units: kelvin
- standard_name: air_temperature
+ standard_name: air_temperature
This method yields the same result as the index selection, however:
@@ -5627,18 +5627,18 @@ Nearest-neighbor sampling.sel indeed returned the data at the temporal value corresponding to the date 2018-01-05
.
@@ -6017,20 +6017,20 @@ Interpolation
Info
@@ -6414,29 +6414,29 @@ Slicing along coordinates
Info
@@ -6818,18 +6818,18 @@ One more selection method: <xarray.DataArray (lat: 3, lon: 4)> Size: 96B
-array([[287.8422476 , 281.86675526, 281.66114533, 286.51895117],
- [274.72806155, 279.52345451, 280.4543508 , 284.10403691],
- [282.79579667, 286.43994545, 275.587234 , 292.30626036]])
+array([[295.03260826, 279.59313303, 290.98832877, 279.77499799],
+ [278.95918871, 272.71420309, 287.82516859, 278.99590275],
+ [283.80477841, 291.16324141, 276.13038116, 283.905546 ]])
Coordinates:
time datetime64[ns] 8B 2018-01-02
* lat (lat) float64 24B 25.0 40.0 55.0
* lon (lon) float64 32B -120.0 -100.0 -80.0 -60.0
Attributes:
units: kelvin
- standard_name: air_temperature
+ standard_name: air_temperature
This selection technique is similar to NumPy’s index-based selection, as shown below:
temp[1,:,:]
@@ -7208,29 +7208,29 @@ One more selection method: <xarray.DataArray (time: 3, lat: 2, lon: 2)> Size: 96B
-array([[[289.87496223, 283.43025556],
- [281.464434 , 287.40603837]],
+array([[[288.57153159, 275.44047043],
+ [283.50611783, 277.53595954]],
- [[281.86675526, 281.66114533],
- [279.52345451, 280.4543508 ]],
+ [[279.59313303, 290.98832877],
+ [272.71420309, 287.82516859]],
- [[276.18696897, 279.02877455],
- [285.98499909, 279.87552066]]])
+ [[271.32639859, 286.92079794],
+ [280.54989636, 274.87552029]]])
Coordinates:
* time (time) datetime64[ns] 24B 2018-01-01 2018-01-02 2018-01-03
* lat (lat) float64 16B 25.0 40.0
* lon (lon) float64 16B -100.0 -80.0
Attributes:
units: kelvin
- standard_name: air_temperature
+ [[271.32639859, 286.92079794],
+ [280.54989636, 274.87552029]]])
- time(time)datetime64[ns]2018-01-01 2018-01-02 2018-01-03
array(['2018-01-01T00:00:00.000000000', '2018-01-02T00:00:00.000000000',
+ '2018-01-03T00:00:00.000000000'], dtype='datetime64[ns]')
- lat(lat)float6425.0 40.0
array([25., 40.])
- lon(lon)float64-100.0 -80.0
array([-100., -80.])
- timePandasIndex
PandasIndex(DatetimeIndex(['2018-01-01', '2018-01-02', '2018-01-03'], dtype='datetime64[ns]', name='time', freq='D'))
- latPandasIndex
PandasIndex(Index([25.0, 40.0], dtype='float64', name='lat'))
- lonPandasIndex
PandasIndex(Index([-100.0, -80.0], dtype='float64', name='lon'))
- units :
- kelvin
- standard_name :
- air_temperature
In contrast with the previous example, this example shows a useful advantage of using the .loc
attribute. When using the .loc
attribute, you can specify data slices using a syntax similar to NumPy in addition to, or instead of, using the slice function. Both of these slicing techniques are illustrated below:
@@ -7604,29 +7604,29 @@ One more selection method: <xarray.DataArray (time: 3, lat: 2, lon: 2)> Size: 96B
-array([[[289.87496223, 283.43025556],
- [281.464434 , 287.40603837]],
+array([[[288.57153159, 275.44047043],
+ [283.50611783, 277.53595954]],
- [[281.86675526, 281.66114533],
- [279.52345451, 280.4543508 ]],
+ [[279.59313303, 290.98832877],
+ [272.71420309, 287.82516859]],
- [[276.18696897, 279.02877455],
- [285.98499909, 279.87552066]]])
+ [[271.32639859, 286.92079794],
+ [280.54989636, 274.87552029]]])
Coordinates:
* time (time) datetime64[ns] 24B 2018-01-01 2018-01-02 2018-01-03
* lat (lat) float64 16B 25.0 40.0
* lon (lon) float64 16B -100.0 -80.0
Attributes:
units: kelvin
- standard_name: air_temperature
+ [[271.32639859, 286.92079794],
+ [280.54989636, 274.87552029]]])
- time(time)datetime64[ns]2018-01-01 2018-01-02 2018-01-03
array(['2018-01-01T00:00:00.000000000', '2018-01-02T00:00:00.000000000',
+ '2018-01-03T00:00:00.000000000'], dtype='datetime64[ns]')
- lat(lat)float6425.0 40.0
array([25., 40.])
- lon(lon)float64-100.0 -80.0
array([-100., -80.])
- timePandasIndex
PandasIndex(DatetimeIndex(['2018-01-01', '2018-01-02', '2018-01-03'], dtype='datetime64[ns]', name='time', freq='D'))
- latPandasIndex
PandasIndex(Index([25.0, 40.0], dtype='float64', name='lat'))
- lonPandasIndex
PandasIndex(Index([-100.0, -80.0], dtype='float64', name='lon'))
- units :
- kelvin
- standard_name :
- air_temperature
As described above, the arguments to .loc
must be in the order of the DataArray
’s dimensions. Attempting to slice data without ordering arguments properly can cause errors, as shown below:
@@ -8059,10 +8059,10 @@ Access netCDF data with
@@ -8504,17 +8504,17 @@ Subsetting the
positive: down
Grib_level_type: 100
_CoordinateAxisType: Pressure
- _CoordinateZisPositive: down
+ dtype='float32', name='isobaric1'))
- units :
- hPa
- long_name :
- Isobaric surface
- positive :
- down
- Grib_level_type :
- 100
- _CoordinateAxisType :
- Pressure
- _CoordinateZisPositive :
- down
(As described earlier in this tutorial, we can also use dictionary syntax to select specific DataArrays
; in this case, we would write ds['isobaric1']
.)
Many of the subsetting operations usable on DataArrays
can also be used on Datasets
. However, when used on Datasets
, these operations are performed on every DataArray
in the Dataset
, as shown below:
@@ -8916,7 +8916,7 @@ Subsetting the
geospatial_lat_min: 10.753308882144761
geospatial_lat_max: 46.8308828962289
geospatial_lon_min: -153.88242040519995
- geospatial_lon_max: -42.666108129242815
As shown above, the subsetting operation performed on the Dataset
returned a new Dataset
. If only a single DataArray
is needed from this new Dataset
, it can be retrieved using the familiar dot notation:
@@ -9356,7 +9356,7 @@ Subsetting the
Grib1_TableVersion: 131
Grib1_Parameter: 11
Grib1_Level_Type: 100
- Grib1_Level_Desc: Isobaric surface
+ dtype='float32', name='x', length=268))
- long_name :
- Temperature @ Isobaric surface
- units :
- K
- description :
- Temperature
- grid_mapping :
- LambertConformal_Projection
- Grib_Variable_Id :
- VAR_7-15-131-11_L100
- Grib1_Center :
- 7
- Grib1_Subcenter :
- 15
- Grib1_TableVersion :
- 131
- Grib1_Parameter :
- 11
- Grib1_Level_Type :
- 100
- Grib1_Level_Desc :
- Isobaric surface
@@ -9790,19 +9790,19 @@ Aggregation operations
+ dtype='float32', name='isobaric1'))
@@ -10226,7 +10226,7 @@ Simple visualization with
-[<matplotlib.lines.Line2D at 0x7fc1f65cbe90>]
+[<matplotlib.lines.Line2D at 0x7f2dcc1e81a0>]
@@ -10250,7 +10250,7 @@ Customizing the plot
-[<matplotlib.lines.Line2D at 0x7fc1e8bafcb0>]
+[<matplotlib.lines.Line2D at 0x7f2d968affb0>]
@@ -10268,7 +10268,7 @@ Plotting 2-D data
-
+ dtype='float64', name='lon', length=360))