Skip to content

Commit 46e1722

Browse files
use correct dataset in lecture
1 parent 714466b commit 46e1722

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

content/xarray.rst

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,18 +36,18 @@ Let's assume now we want to take a look at a specific value in the dataset at a
3636

3737
OK, we got a value, but how do we know whether this value corresponds to the correct height, latitude and longitude? Are we sure that latitude was the second dimension in the dataset? Was it the second or third index that corresponds to the correct position? In pure NumPy, we are mostly left in the dark and need to manually keep track of these things.
3838

39-
Unfortunately, Pandas isn't of much help either since it is not designed for data with more than 2 dimensions. Fortunately, some clever climate scientists have come up with a solution to this problem and created Xarray.
39+
Unfortunately, Pandas isn't of much help either since it is not designed for data with more than 2 dimensions. Fortunately, `some clever climate scientists <https://github.com/pydata/xarray/graphs/contributors>`_ have come up with a solution to this problem and created Xarray.
4040

4141
What is Xarray?
4242
----------------
4343

4444
Xarray is a powerful Python library that introduces labelled multidimensional arrays.
45-
We will first download an dataset similar to the example above to illustrate the advantages of Xarray. We will cover how to transform your own data into an Xarray Dataset later in this lecture.
45+
We will first download a dataset similar to the example above to illustrate the advantages of Xarray. We will cover how to transform your own data into an Xarray Dataset later in this lecture.
4646

4747
Let us open a python shell and download a public dataset: ::
4848
4949
>>> from pythia_datasets import DATASETS
50-
>>> filepath = DATASETS.fetch('CESM2_sst_data.nc')
50+
>>> filepath = DATASETS.fetch('NARR_19930313_0000.nc')
5151

5252
We can now import xarray and open the dataset. Le'ts take a look at what it contains: ::
5353

@@ -85,10 +85,10 @@ We can now import xarray and open the dataset. Le'ts take a look at what it cont
8585

8686
That was a lot of information at once, but let's break it down.
8787

88-
- Close to the top of the output we see the dimensions of the dataset: time1, isobaric1, y, and x.
89-
- Below the dimensions, we see the coordinates of the dataset. These are the labels for the dimensions and give us the values of the dimension at each index.
90-
- The data variables are the actual data stored in the dataset.
91-
- At the bottom, we see the attributes of the dataset. This is a dictionary that stores metadata about the dataset.
88+
- Close to the top of the output we see the ``Dimensions`` of the dataset: ``time1``, ``isobaric1``, ``y``, and ``x``.
89+
- Below the dimensions, we see the ``Coordinates`` of the dataset. These are the labels for the dimensions and give us the values of the dimension at each index.
90+
- The ``Data variables`` are the actual data stored in the dataset.
91+
- At the bottom, we see the ``Attributes`` of the dataset. This is a dictionary that stores metadata about the dataset.
9292

9393

9494
The following image shows the structure of this particular Xarray Dataset:
@@ -105,7 +105,7 @@ We can select a Data variable from the dataset using a dictionary-like syntax: :
105105

106106
The new variable ``temperature_data`` is a ``DataArray`` object. An xarray ``Dataset`` typically consists of multiple ``DataArrays``.
107107

108-
Xarray uses Numpy arrays under the hood, we can always access the raw data using the ``.values`` attribute: ::
108+
Xarray uses Numpy(-like) arrays under the hood, we can always access the raw data using the ``.values`` attribute: ::
109109

110110
temperature_numpy = ds['Temperature_isobaric'].values
111111

0 commit comments

Comments
 (0)