--- /srv/reproducible-results/rbuild-debian/r-b-build.bIYNc0Uh/b1/python-xarray_0.16.2-2_armhf.changes +++ /srv/reproducible-results/rbuild-debian/r-b-build.bIYNc0Uh/b2/python-xarray_0.16.2-2_armhf.changes ├── Files │ @@ -1,3 +1,3 @@ │ │ - 33684a9d31366540230b5fdbb8149e80 2042576 doc optional python-xarray-doc_0.16.2-2_all.deb │ + bb5a32e8c261fd0fdc1c143926364dbd 2042584 doc optional python-xarray-doc_0.16.2-2_all.deb │ 9a2456450e2c51d89ccb00d8c4a100d8 486600 python optional python3-xarray_0.16.2-2_all.deb ├── python-xarray-doc_0.16.2-2_all.deb │ ├── file list │ │ @@ -1,3 +1,3 @@ │ │ -rw-r--r-- 0 0 0 4 2021-01-02 13:06:33.000000 debian-binary │ │ --rw-r--r-- 0 0 0 4980 2021-01-02 13:06:33.000000 control.tar.xz │ │ --rw-r--r-- 0 0 0 2037404 2021-01-02 13:06:33.000000 data.tar.xz │ │ +-rw-r--r-- 0 0 0 4976 2021-01-02 13:06:33.000000 control.tar.xz │ │ +-rw-r--r-- 0 0 0 2037416 2021-01-02 13:06:33.000000 data.tar.xz │ ├── control.tar.xz │ │ ├── control.tar │ │ │ ├── ./md5sums │ │ │ │ ├── ./md5sums │ │ │ │ │┄ Files differ │ ├── data.tar.xz │ │ ├── data.tar │ │ │ ├── file list │ │ │ │ @@ -178,54 +178,54 @@ │ │ │ │ -rw-r--r-- 0 root (0) root (0) 412 2020-12-01 07:05:15.000000 ./usr/share/doc/python-xarray-doc/html/_static/style.css │ │ │ │ -rw-r--r-- 0 root (0) root (0) 23991 2021-01-02 13:06:33.000000 ./usr/share/doc/python-xarray-doc/html/_static/where_example.png │ │ │ │ -rw-r--r-- 0 root (0) root (0) 8018 2021-01-02 13:06:33.000000 ./usr/share/doc/python-xarray-doc/html/api-hidden.html │ │ │ │ -rw-r--r-- 0 root (0) root (0) 35061 2021-01-02 13:06:33.000000 ./usr/share/doc/python-xarray-doc/html/api.html │ │ │ │ -rw-r--r-- 0 root (0) root (0) 57284 2021-01-02 13:06:33.000000 ./usr/share/doc/python-xarray-doc/html/combining.html │ │ │ │ -rw-r--r-- 0 root (0) root (0) 110206 2021-01-02 13:06:33.000000 ./usr/share/doc/python-xarray-doc/html/computation.html │ │ │ │ -rw-r--r-- 0 root (0) root (0) 90070 2021-01-02 13:06:33.000000 ./usr/share/doc/python-xarray-doc/html/contributing.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 79117 2021-01-02 13:06:33.000000 ./usr/share/doc/python-xarray-doc/html/dask.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 79208 2021-01-02 13:06:33.000000 ./usr/share/doc/python-xarray-doc/html/dask.html │ │ │ │ -rw-r--r-- 0 root (0) root (0) 102955 2021-01-02 13:06:33.000000 ./usr/share/doc/python-xarray-doc/html/data-structures.html │ │ │ │ -rw-r--r-- 0 root (0) root (0) 17225 2021-01-02 13:06:33.000000 ./usr/share/doc/python-xarray-doc/html/duckarrays.html │ │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2021-01-02 13:06:33.000000 ./usr/share/doc/python-xarray-doc/html/examples/ │ │ │ │ --rw-r--r-- 0 root (0) root (0) 68084 2021-01-02 13:06:33.000000 ./usr/share/doc/python-xarray-doc/html/examples/ERA5-GRIB-example.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 68085 2021-01-02 13:06:33.000000 ./usr/share/doc/python-xarray-doc/html/examples/ERA5-GRIB-example.html │ │ │ │ -rw-r--r-- 0 root (0) root (0) 5090 2021-01-02 13:06:33.000000 ./usr/share/doc/python-xarray-doc/html/examples/ERA5-GRIB-example.ipynb.gz │ │ │ │ --rw-r--r-- 0 root (0) root (0) 49514 2021-01-02 13:06:33.000000 ./usr/share/doc/python-xarray-doc/html/examples/ROMS_ocean_model.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 49515 2021-01-02 13:06:33.000000 ./usr/share/doc/python-xarray-doc/html/examples/ROMS_ocean_model.html │ │ │ │ -rw-r--r-- 0 root (0) root (0) 18700 2021-01-02 13:06:33.000000 ./usr/share/doc/python-xarray-doc/html/examples/ROMS_ocean_model.ipynb.gz │ │ │ │ --rw-r--r-- 0 root (0) root (0) 107469 2021-01-02 13:06:33.000000 ./usr/share/doc/python-xarray-doc/html/examples/apply_ufunc_vectorize_1d.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 107470 2021-01-02 13:06:33.000000 ./usr/share/doc/python-xarray-doc/html/examples/apply_ufunc_vectorize_1d.html │ │ │ │ -rw-r--r-- 0 root (0) root (0) 8091 2021-01-02 13:06:33.000000 ./usr/share/doc/python-xarray-doc/html/examples/apply_ufunc_vectorize_1d.ipynb.gz │ │ │ │ --rw-r--r-- 0 root (0) root (0) 38212 2021-01-02 13:06:33.000000 ./usr/share/doc/python-xarray-doc/html/examples/area_weighted_temperature.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 14552 2021-01-02 13:06:33.000000 ./usr/share/doc/python-xarray-doc/html/examples/area_weighted_temperature.ipynb.gz │ │ │ │ --rw-r--r-- 0 root (0) root (0) 47846 2021-01-02 13:06:33.000000 ./usr/share/doc/python-xarray-doc/html/examples/monthly-means.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 3166 2021-01-02 13:06:33.000000 ./usr/share/doc/python-xarray-doc/html/examples/monthly-means.ipynb.gz │ │ │ │ --rw-r--r-- 0 root (0) root (0) 41913 2021-01-02 13:06:33.000000 ./usr/share/doc/python-xarray-doc/html/examples/multidimensional-coords.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 38213 2021-01-02 13:06:33.000000 ./usr/share/doc/python-xarray-doc/html/examples/area_weighted_temperature.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 14555 2021-01-02 13:06:33.000000 ./usr/share/doc/python-xarray-doc/html/examples/area_weighted_temperature.ipynb.gz │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 47847 2021-01-02 13:06:33.000000 ./usr/share/doc/python-xarray-doc/html/examples/monthly-means.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 3168 2021-01-02 13:06:33.000000 ./usr/share/doc/python-xarray-doc/html/examples/monthly-means.ipynb.gz │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 41914 2021-01-02 13:06:33.000000 ./usr/share/doc/python-xarray-doc/html/examples/multidimensional-coords.html │ │ │ │ -rw-r--r-- 0 root (0) root (0) 7546 2021-01-02 13:06:33.000000 ./usr/share/doc/python-xarray-doc/html/examples/multidimensional-coords.ipynb.gz │ │ │ │ --rw-r--r-- 0 root (0) root (0) 81212 2021-01-02 13:06:33.000000 ./usr/share/doc/python-xarray-doc/html/examples/visualization_gallery.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 5304 2021-01-02 13:06:33.000000 ./usr/share/doc/python-xarray-doc/html/examples/visualization_gallery.ipynb.gz │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 81213 2021-01-02 13:06:33.000000 ./usr/share/doc/python-xarray-doc/html/examples/visualization_gallery.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 5303 2021-01-02 13:06:33.000000 ./usr/share/doc/python-xarray-doc/html/examples/visualization_gallery.ipynb.gz │ │ │ │ -rw-r--r-- 0 root (0) root (0) 90692 2021-01-02 13:06:33.000000 ./usr/share/doc/python-xarray-doc/html/examples/weather-data.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 208640 2021-01-02 13:06:33.000000 ./usr/share/doc/python-xarray-doc/html/examples/weather-data.ipynb.gz │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 208637 2021-01-02 13:06:33.000000 ./usr/share/doc/python-xarray-doc/html/examples/weather-data.ipynb.gz │ │ │ │ -rw-r--r-- 0 root (0) root (0) 12844 2021-01-02 13:06:33.000000 ./usr/share/doc/python-xarray-doc/html/examples.html │ │ │ │ -rw-r--r-- 0 root (0) root (0) 33153 2021-01-02 13:06:33.000000 ./usr/share/doc/python-xarray-doc/html/faq.html │ │ │ │ -rw-r--r-- 0 root (0) root (0) 9794 2021-01-02 13:06:33.000000 ./usr/share/doc/python-xarray-doc/html/genindex.html │ │ │ │ -rw-r--r-- 0 root (0) root (0) 38989 2021-01-02 13:06:33.000000 ./usr/share/doc/python-xarray-doc/html/groupby.html │ │ │ │ -rw-r--r-- 0 root (0) root (0) 19098 2021-01-02 13:06:33.000000 ./usr/share/doc/python-xarray-doc/html/howdoi.html │ │ │ │ -rw-r--r-- 0 root (0) root (0) 17531 2021-01-02 13:06:33.000000 ./usr/share/doc/python-xarray-doc/html/index.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 183015 2021-01-02 13:06:33.000000 ./usr/share/doc/python-xarray-doc/html/indexing.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 183016 2021-01-02 13:06:33.000000 ./usr/share/doc/python-xarray-doc/html/indexing.html │ │ │ │ -rw-r--r-- 0 root (0) root (0) 24660 2021-01-02 13:06:33.000000 ./usr/share/doc/python-xarray-doc/html/installing.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 34148 2021-01-02 13:06:33.000000 ./usr/share/doc/python-xarray-doc/html/internals.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 89961 2021-01-02 13:06:33.000000 ./usr/share/doc/python-xarray-doc/html/interpolation.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 34149 2021-01-02 13:06:33.000000 ./usr/share/doc/python-xarray-doc/html/internals.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 89962 2021-01-02 13:06:33.000000 ./usr/share/doc/python-xarray-doc/html/interpolation.html │ │ │ │ -rw-r--r-- 0 root (0) root (0) 125219 2021-01-02 13:06:33.000000 ./usr/share/doc/python-xarray-doc/html/io.html │ │ │ │ -rw-r--r-- 0 root (0) root (0) 13348 2021-01-02 13:06:33.000000 ./usr/share/doc/python-xarray-doc/html/objects.inv │ │ │ │ -rw-r--r-- 0 root (0) root (0) 41507 2021-01-02 13:06:33.000000 ./usr/share/doc/python-xarray-doc/html/pandas.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 208535 2021-01-02 13:06:33.000000 ./usr/share/doc/python-xarray-doc/html/plotting.html │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 208537 2021-01-02 13:06:33.000000 ./usr/share/doc/python-xarray-doc/html/plotting.html │ │ │ │ -rw-r--r-- 0 root (0) root (0) 46150 2021-01-02 13:06:33.000000 ./usr/share/doc/python-xarray-doc/html/quick-overview.html │ │ │ │ -rw-r--r-- 0 root (0) root (0) 21186 2021-01-02 13:06:33.000000 ./usr/share/doc/python-xarray-doc/html/related-projects.html │ │ │ │ -rw-r--r-- 0 root (0) root (0) 56597 2021-01-02 13:06:33.000000 ./usr/share/doc/python-xarray-doc/html/reshaping.html │ │ │ │ -rw-r--r-- 0 root (0) root (0) 22480 2021-01-02 13:06:33.000000 ./usr/share/doc/python-xarray-doc/html/roadmap.html │ │ │ │ -rw-r--r-- 0 root (0) root (0) 7920 2021-01-02 13:06:33.000000 ./usr/share/doc/python-xarray-doc/html/search.html │ │ │ │ --rw-r--r-- 0 root (0) root (0) 100390 2021-01-02 13:06:33.000000 ./usr/share/doc/python-xarray-doc/html/searchindex.js │ │ │ │ +-rw-r--r-- 0 root (0) root (0) 100400 2021-01-02 13:06:33.000000 ./usr/share/doc/python-xarray-doc/html/searchindex.js │ │ │ │ -rw-r--r-- 0 root (0) root (0) 20789 2021-01-02 13:06:33.000000 ./usr/share/doc/python-xarray-doc/html/terminology.html │ │ │ │ -rw-r--r-- 0 root (0) root (0) 39876 2021-01-02 13:06:33.000000 ./usr/share/doc/python-xarray-doc/html/time-series.html │ │ │ │ -rw-r--r-- 0 root (0) root (0) 41691 2021-01-02 13:06:33.000000 ./usr/share/doc/python-xarray-doc/html/weather-climate.html │ │ │ │ -rw-r--r-- 0 root (0) root (0) 574379 2021-01-02 13:06:33.000000 ./usr/share/doc/python-xarray-doc/html/whats-new.html │ │ │ │ -rw-r--r-- 0 root (0) root (0) 18651 2021-01-02 13:06:33.000000 ./usr/share/doc/python-xarray-doc/html/why-xarray.html │ │ │ │ drwxr-xr-x 0 root (0) root (0) 0 2021-01-02 13:06:33.000000 ./usr/share/doc-base/ │ │ │ │ -rw-r--r-- 0 root (0) root (0) 290 2021-01-02 13:06:33.000000 ./usr/share/doc-base/python-xarray-doc │ │ │ ├── ./usr/share/doc/python-xarray-doc/html/dask.html │ │ │ │ @@ -300,15 +300,15 @@ │ │ │ │

You’ll notice that printing a dataset still shows a preview of array values, │ │ │ │ even if they are actually Dask arrays. We can do this quickly with Dask because │ │ │ │ we only need to compute the first few values (typically from the first block). │ │ │ │ To reveal the true nature of an array, print a DataArray:

│ │ │ │
In [3]: ds.temperature
│ │ │ │  Out[3]: 
│ │ │ │  <xarray.DataArray 'temperature' (time: 30, latitude: 180, longitude: 180)>
│ │ │ │ -dask.array<open_dataset-8991b1b144f62b67334e42d6ce128e3etemperature, shape=(30, 180, 180), dtype=float64, chunksize=(10, 180, 180), chunktype=numpy.ndarray>
│ │ │ │ +dask.array<open_dataset-616fe0734e26416bb4b6b0639e0646cdtemperature, shape=(30, 180, 180), dtype=float64, chunksize=(10, 180, 180), chunktype=numpy.ndarray>
│ │ │ │  Coordinates:
│ │ │ │    * time       (time) datetime64[ns] 2015-01-01 2015-01-02 ... 2015-01-30
│ │ │ │    * longitude  (longitude) int32 0 1 2 3 4 5 6 7 ... 173 174 175 176 177 178 179
│ │ │ │    * latitude   (latitude) float64 89.5 88.5 87.5 86.5 ... -87.5 -88.5 -89.5
│ │ │ │  
│ │ │ │
│ │ │ │

Once you’ve manipulated a Dask array, you can still write a dataset too big to │ │ │ │ @@ -325,15 +325,16 @@ │ │ │ │ In [6]: delayed_obj = ds.to_netcdf("manipulated-example-data.nc", compute=False) │ │ │ │ │ │ │ │ In [7]: with ProgressBar(): │ │ │ │ ...: results = delayed_obj.compute() │ │ │ │ ...: │ │ │ │ │ │ │ │ [ ] | 0% Completed | 0.0s │ │ │ │ -[########################################] | 100% Completed | 0.1s │ │ │ │ +[############### ] | 37% Completed | 0.2s │ │ │ │ +[########################################] | 100% Completed | 0.3s │ │ │ │ │ │ │ │ │ │ │ │

│ │ │ │

Note

│ │ │ │

When using Dask’s distributed scheduler to write NETCDF4 files, │ │ │ │ it may be necessary to set the environment variable HDF5_USE_FILE_LOCKING=FALSE │ │ │ │ to avoid competing locks within the HDF5 SWMR file locking scheme. Note that │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -114,15 +114,15 @@ │ │ │ │ │ You’ll notice that printing a dataset still shows a preview of array values, │ │ │ │ │ even if they are actually Dask arrays. We can do this quickly with Dask because │ │ │ │ │ we only need to compute the first few values (typically from the first block). │ │ │ │ │ To reveal the true nature of an array, print a DataArray: │ │ │ │ │ In [3]: ds.temperature │ │ │ │ │ Out[3]: │ │ │ │ │ │ │ │ │ │ -dask.array │ │ │ │ │ Coordinates: │ │ │ │ │ * time (time) datetime64[ns] 2015-01-01 2015-01-02 ... 2015-01-30 │ │ │ │ │ * longitude (longitude) int32 0 1 2 3 4 5 6 7 ... 173 174 175 176 177 178 │ │ │ │ │ 179 │ │ │ │ │ * latitude (latitude) float64 89.5 88.5 87.5 86.5 ... -87.5 -88.5 -89.5 │ │ │ │ │ Once you’ve manipulated a Dask array, you can still write a dataset too big │ │ │ │ │ @@ -137,15 +137,16 @@ │ │ │ │ │ compute=False) │ │ │ │ │ │ │ │ │ │ In [7]: with ProgressBar(): │ │ │ │ │ ...: results = delayed_obj.compute() │ │ │ │ │ ...: │ │ │ │ │ │ │ │ │ │ [ ] | 0% Completed | 0.0s │ │ │ │ │ -[########################################] | 100% Completed | 0.1s │ │ │ │ │ +[############### ] | 37% Completed | 0.2s │ │ │ │ │ +[########################################] | 100% Completed | 0.3s │ │ │ │ │ Note │ │ │ │ │ When using Dask’s distributed scheduler to write NETCDF4 files, it may be │ │ │ │ │ necessary to set the environment variableHDF5_USE_FILE_LOCKING=FALSEto avoid │ │ │ │ │ competing locks within the HDF5 SWMR file locking scheme. Note that writing │ │ │ │ │ netCDF files with Dask’s distributed scheduler is only supported for │ │ │ │ │ thenetcdf4backend. │ │ │ │ │ A dataset can also be converted to a Dask DataFrame using to_dask_dataframe(). │ │ │ ├── ./usr/share/doc/python-xarray-doc/html/data-structures.html │ │ │ │ @@ -892,18 +892,18 @@ │ │ │ │ a method call with an external function (e.g., ds.pipe(func)) instead of │ │ │ │ simply calling it (e.g., func(ds)). This allows you to write pipelines for │ │ │ │ transforming your data (using “method chaining”) instead of writing hard to │ │ │ │ follow nested function calls:

│ │ │ │
# these lines are equivalent, but with pipe we can make the logic flow
│ │ │ │  # entirely from left to right
│ │ │ │  In [60]: plt.plot((2 * ds.temperature.sel(x=0)).mean("y"))
│ │ │ │ -Out[60]: [<matplotlib.lines.Line2D at 0xe7fb6ef8>]
│ │ │ │ +Out[60]: [<matplotlib.lines.Line2D at 0xa50b1fb8>]
│ │ │ │  
│ │ │ │  In [61]: (ds.temperature.sel(x=0).pipe(lambda x: 2 * x).mean("y").pipe(plt.plot))
│ │ │ │ -Out[61]: [<matplotlib.lines.Line2D at 0xe7fbd2b0>]
│ │ │ │ +Out[61]: [<matplotlib.lines.Line2D at 0xa50ba370>]
│ │ │ │  
│ │ │ │
│ │ │ │

Both pipe and assign replicate the pandas methods of the same names │ │ │ │ (DataFrame.pipe and │ │ │ │ DataFrame.assign).

│ │ │ │

With xarray, there is no performance penalty for creating new datasets, even if │ │ │ │ variables are lazily loaded from a file on disk. Creating new objects instead │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -619,19 +619,19 @@ │ │ │ │ │ There is also the pipe() method that allows you to use a method call with an │ │ │ │ │ external function (e.g., ds.pipe(func)) instead of simply calling it (e.g., │ │ │ │ │ func(ds)). This allows you to write pipelines for transforming your data (using │ │ │ │ │ “method chaining”) instead of writing hard to follow nested function calls: │ │ │ │ │ # these lines are equivalent, but with pipe we can make the logic flow │ │ │ │ │ # entirely from left to right │ │ │ │ │ In [60]: plt.plot((2 * ds.temperature.sel(x=0)).mean("y")) │ │ │ │ │ -Out[60]: [] │ │ │ │ │ +Out[60]: [] │ │ │ │ │ │ │ │ │ │ In [61]: (ds.temperature.sel(x=0).pipe(lambda x: 2 * x).mean("y").pipe │ │ │ │ │ (plt.plot)) │ │ │ │ │ -Out[61]: [] │ │ │ │ │ +Out[61]: [] │ │ │ │ │ Both pipe and assign replicate the pandas methods of the same names │ │ │ │ │ (DataFrame.pipe and DataFrame.assign). │ │ │ │ │ With xarray, there is no performance penalty for creating new datasets, even if │ │ │ │ │ variables are lazily loaded from a file on disk. Creating new objects instead │ │ │ │ │ of mutating existing objects often results in easier to understand code, so we │ │ │ │ │ encourage using this approach. │ │ │ │ │ **** Renaming variables¶ **** │ │ │ ├── ./usr/share/doc/python-xarray-doc/html/examples/ERA5-GRIB-example.html │ │ │ │ @@ -523,15 +523,15 @@ │ │ │ │ /build/reproducible-path/python-xarray-0.16.2/xarray/tutorial.py in open_dataset(name, cache, cache_dir, github_url, branch, **kws) │ │ │ │ 76 # May want to add an option to remove it. │ │ │ │ 77 if not _os.path.isdir(longdir): │ │ │ │ ---> 78 _os.mkdir(longdir) │ │ │ │ 79 │ │ │ │ 80 url = "/".join((github_url, "raw", branch, fullname)) │ │ │ │ │ │ │ │ -FileNotFoundError: [Errno 2] No such file or directory: '/nonexistent/first-build/.xarray_tutorial_data' │ │ │ │ +FileNotFoundError: [Errno 2] No such file or directory: '/nonexistent/second-build/.xarray_tutorial_data' │ │ │ │

│ │ │ │ │ │ │ │

Let’s create a simple plot of 2-m air temperature in degrees Celsius:

│ │ │ │
│ │ │ │
[3]:
│ │ │ │  
│ │ │ │
│ │ │ │ ├── html2text {} │ │ │ │ │ @@ -84,15 +84,15 @@ │ │ │ │ │ open_dataset(name, cache, cache_dir, github_url, branch, **kws) │ │ │ │ │ 76 # May want to add an option to remove it. │ │ │ │ │ 77 if not _os.path.isdir(longdir): │ │ │ │ │ ---> 78 _os.mkdir(longdir) │ │ │ │ │ 79 │ │ │ │ │ 80 url = "/".join((github_url, "raw", branch, fullname)) │ │ │ │ │ │ │ │ │ │ -FileNotFoundError: [Errno 2] No such file or directory: '/nonexistent/first- │ │ │ │ │ +FileNotFoundError: [Errno 2] No such file or directory: '/nonexistent/second- │ │ │ │ │ build/.xarray_tutorial_data' │ │ │ │ │ Let’s create a simple plot of 2-m air temperature in degrees Celsius: │ │ │ │ │ [3]: │ │ │ │ │ ds = ds - 273.15 │ │ │ │ │ ds.t2m[0].plot(cmap=plt.cm.coolwarm) │ │ │ │ │ --------------------------------------------------------------------------- │ │ │ │ │ NameError Traceback (most recent call last) │ │ │ ├── ./usr/share/doc/python-xarray-doc/html/examples/ERA5-GRIB-example.ipynb.gz │ │ │ │ ├── ERA5-GRIB-example.ipynb │ │ │ │ │ ├── Pretty-printed │ │ │ │ │ │┄ Similarity: 0.9998173701298702% │ │ │ │ │ │┄ Differences: {"'cells'": '{4: {\'outputs\': {0: {\'evalue\': "[Errno 2] No such file or directory: ' │ │ │ │ │ │┄ '\'/nonexistent/second-build/.xarray_tutorial_data\'", \'traceback\': {insert: [(5, ' │ │ │ │ │ │┄ '"\\x1b[0;31mFileNotFoundError\\x1b[0m: [Errno 2] No such file or directory: ' │ │ │ │ │ │┄ '\'/nonexistent/second-build/.xarray_tutorial_data\'")], delete: [5]}}}}}'} │ │ │ │ │ │ @@ -34,23 +34,23 @@ │ │ │ │ │ │ { │ │ │ │ │ │ "cell_type": "code", │ │ │ │ │ │ "execution_count": 2, │ │ │ │ │ │ "metadata": {}, │ │ │ │ │ │ "outputs": [ │ │ │ │ │ │ { │ │ │ │ │ │ "ename": "FileNotFoundError", │ │ │ │ │ │ - "evalue": "[Errno 2] No such file or directory: '/nonexistent/first-build/.xarray_tutorial_data'", │ │ │ │ │ │ + "evalue": "[Errno 2] No such file or directory: '/nonexistent/second-build/.xarray_tutorial_data'", │ │ │ │ │ │ "output_type": "error", │ │ │ │ │ │ "traceback": [ │ │ │ │ │ │ "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", │ │ │ │ │ │ "\u001b[0;31mFileNotFoundError\u001b[0m Traceback (most recent call last)", │ │ │ │ │ │ "\u001b[0;32m\u001b[0m in \u001b[0;36m\u001b[0;34m\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0mds\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mxr\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mtutorial\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mload_dataset\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m'era5-2mt-2019-03-uk.grib'\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mengine\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;34m'cfgrib'\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m", │ │ │ │ │ │ "\u001b[0;32m/build/reproducible-path/python-xarray-0.16.2/xarray/tutorial.py\u001b[0m in \u001b[0;36mload_dataset\u001b[0;34m(*args, **kwargs)\u001b[0m\n\u001b[1;32m 111\u001b[0m \u001b[0mopen_dataset\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 112\u001b[0m \"\"\"\n\u001b[0;32m--> 113\u001b[0;31m \u001b[0;32mwith\u001b[0m \u001b[0mopen_dataset\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m*\u001b[0m\u001b[0margs\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m**\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;32mas\u001b[0m \u001b[0mds\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 114\u001b[0m \u001b[0;32mreturn\u001b[0m \u001b[0mds\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mload\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 115\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n", │ │ │ │ │ │ "\u001b[0;32m/build/reproducible-path/python-xarray-0.16.2/xarray/tutorial.py\u001b[0m in \u001b[0;36mopen_dataset\u001b[0;34m(name, cache, cache_dir, github_url, branch, **kws)\u001b[0m\n\u001b[1;32m 76\u001b[0m \u001b[0;31m# May want to add an option to remove it.\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 77\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0;32mnot\u001b[0m \u001b[0m_os\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mpath\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0misdir\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mlongdir\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 78\u001b[0;31m \u001b[0m_os\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mmkdir\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mlongdir\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 79\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 80\u001b[0m \u001b[0murl\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;34m\"/\"\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mjoin\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mgithub_url\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m\"raw\"\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mbranch\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mfullname\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", │ │ │ │ │ │ - "\u001b[0;31mFileNotFoundError\u001b[0m: [Errno 2] No such file or directory: '/nonexistent/first-build/.xarray_tutorial_data'" │ │ │ │ │ │ + "\u001b[0;31mFileNotFoundError\u001b[0m: [Errno 2] No such file or directory: '/nonexistent/second-build/.xarray_tutorial_data'" │ │ │ │ │ │ ] │ │ │ │ │ │ } │ │ │ │ │ │ ], │ │ │ │ │ │ "source": [ │ │ │ │ │ │ "ds = xr.tutorial.load_dataset('era5-2mt-2019-03-uk.grib', engine='cfgrib')" │ │ │ │ │ │ ] │ │ │ │ │ │ }, │ │ │ ├── ./usr/share/doc/python-xarray-doc/html/examples/ROMS_ocean_model.html │ │ │ │ @@ -561,15 +561,15 @@ │ │ │ │ /build/reproducible-path/python-xarray-0.16.2/xarray/tutorial.py in open_dataset(name, cache, cache_dir, github_url, branch, **kws) │ │ │ │ 76 # May want to add an option to remove it. │ │ │ │ 77 if not _os.path.isdir(longdir): │ │ │ │ ---> 78 _os.mkdir(longdir) │ │ │ │ 79 │ │ │ │ 80 url = "/".join((github_url, "raw", branch, fullname)) │ │ │ │ │ │ │ │ -FileNotFoundError: [Errno 2] No such file or directory: '/nonexistent/first-build/.xarray_tutorial_data' │ │ │ │ +FileNotFoundError: [Errno 2] No such file or directory: '/nonexistent/second-build/.xarray_tutorial_data' │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │

Add a lazilly calculated vertical coordinates

│ │ │ │

Write equations to calculate the vertical coordinate. These will be only evaluated when data is requested. Information about the ROMS vertical coordinate can be found (here)[https://www.myroms.org/wiki/Vertical_S-coordinate]

│ │ │ │

In short, for Vtransform==2 as used in this example,

│ │ │ │ ├── html2text {} │ │ │ │ │ @@ -125,15 +125,15 @@ │ │ │ │ │ open_dataset(name, cache, cache_dir, github_url, branch, **kws) │ │ │ │ │ 76 # May want to add an option to remove it. │ │ │ │ │ 77 if not _os.path.isdir(longdir): │ │ │ │ │ ---> 78 _os.mkdir(longdir) │ │ │ │ │ 79 │ │ │ │ │ 80 url = "/".join((github_url, "raw", branch, fullname)) │ │ │ │ │ │ │ │ │ │ -FileNotFoundError: [Errno 2] No such file or directory: '/nonexistent/first- │ │ │ │ │ +FileNotFoundError: [Errno 2] No such file or directory: '/nonexistent/second- │ │ │ │ │ build/.xarray_tutorial_data' │ │ │ │ │ ***** Add a lazilly calculated vertical coordinates¶ ***** │ │ │ │ │ Write equations to calculate the vertical coordinate. These will be only │ │ │ │ │ evaluated when data is requested. Information about the ROMS vertical │ │ │ │ │ coordinate can be found (here)[https://www.myroms.org/wiki/Vertical_S- │ │ │ │ │ coordinate] │ │ │ │ │ In short, for Vtransform==2 as used in this example, │ │ │ ├── ./usr/share/doc/python-xarray-doc/html/examples/ROMS_ocean_model.ipynb.gz │ │ │ │ ├── ROMS_ocean_model.ipynb │ │ │ │ │ ├── Pretty-printed │ │ │ │ │ │┄ Similarity: 0.9998774509803922% │ │ │ │ │ │┄ Differences: {"'cells'": '{5: {\'outputs\': {0: {\'evalue\': "[Errno 2] No such file or directory: ' │ │ │ │ │ │┄ '\'/nonexistent/second-build/.xarray_tutorial_data\'", \'traceback\': {insert: [(4, ' │ │ │ │ │ │┄ '"\\x1b[0;31mFileNotFoundError\\x1b[0m: [Errno 2] No such file or directory: ' │ │ │ │ │ │┄ '\'/nonexistent/second-build/.xarray_tutorial_data\'")], delete: [4]}}}}}'} │ │ │ │ │ │ @@ -69,22 +69,22 @@ │ │ │ │ │ │ { │ │ │ │ │ │ "cell_type": "code", │ │ │ │ │ │ "execution_count": 2, │ │ │ │ │ │ "metadata": {}, │ │ │ │ │ │ "outputs": [ │ │ │ │ │ │ { │ │ │ │ │ │ "ename": "FileNotFoundError", │ │ │ │ │ │ - "evalue": "[Errno 2] No such file or directory: '/nonexistent/first-build/.xarray_tutorial_data'", │ │ │ │ │ │ + "evalue": "[Errno 2] No such file or directory: '/nonexistent/second-build/.xarray_tutorial_data'", │ │ │ │ │ │ "output_type": "error", │ │ │ │ │ │ "traceback": [ │ │ │ │ │ │ "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", │ │ │ │ │ │ "\u001b[0;31mFileNotFoundError\u001b[0m Traceback (most recent call last)", │ │ │ │ │ │ "\u001b[0;32m\u001b[0m in \u001b[0;36m\u001b[0;34m\u001b[0m\n\u001b[1;32m 1\u001b[0m \u001b[0;31m# load in the file\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m----> 2\u001b[0;31m \u001b[0mds\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mxr\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mtutorial\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mopen_dataset\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m'ROMS_example.nc'\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mchunks\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;34m{\u001b[0m\u001b[0;34m'ocean_time'\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0;36m1\u001b[0m\u001b[0;34m}\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 3\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 4\u001b[0m \u001b[0;31m# This is a way to turn on chunking and lazy evaluation. Opening with mfdataset, or\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 5\u001b[0m \u001b[0;31m# setting the chunking in the open_dataset would also achive this.\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", │ │ │ │ │ │ "\u001b[0;32m/build/reproducible-path/python-xarray-0.16.2/xarray/tutorial.py\u001b[0m in \u001b[0;36mopen_dataset\u001b[0;34m(name, cache, cache_dir, github_url, branch, **kws)\u001b[0m\n\u001b[1;32m 76\u001b[0m \u001b[0;31m# May want to add an option to remove it.\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 77\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0;32mnot\u001b[0m \u001b[0m_os\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mpath\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0misdir\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mlongdir\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 78\u001b[0;31m \u001b[0m_os\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mmkdir\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mlongdir\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 79\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 80\u001b[0m \u001b[0murl\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;34m\"/\"\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mjoin\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mgithub_url\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m\"raw\"\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mbranch\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mfullname\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", │ │ │ │ │ │ - "\u001b[0;31mFileNotFoundError\u001b[0m: [Errno 2] No such file or directory: '/nonexistent/first-build/.xarray_tutorial_data'" │ │ │ │ │ │ + "\u001b[0;31mFileNotFoundError\u001b[0m: [Errno 2] No such file or directory: '/nonexistent/second-build/.xarray_tutorial_data'" │ │ │ │ │ │ ] │ │ │ │ │ │ } │ │ │ │ │ │ ], │ │ │ │ │ │ "source": [ │ │ │ │ │ │ "# load in the file\n", │ │ │ │ │ │ "ds = xr.tutorial.open_dataset('ROMS_example.nc', chunks={'ocean_time': 1})\n", │ │ │ │ │ │ "\n", │ │ │ ├── ./usr/share/doc/python-xarray-doc/html/examples/apply_ufunc_vectorize_1d.html │ │ │ │ @@ -555,15 +555,15 @@ │ │ │ │ /build/reproducible-path/python-xarray-0.16.2/xarray/tutorial.py in open_dataset(name, cache, cache_dir, github_url, branch, **kws) │ │ │ │ 76 # May want to add an option to remove it. │ │ │ │ 77 if not _os.path.isdir(longdir): │ │ │ │ ---> 78 _os.mkdir(longdir) │ │ │ │ 79 │ │ │ │ 80 url = "/".join((github_url, "raw", branch, fullname)) │ │ │ │ │ │ │ │ -FileNotFoundError: [Errno 2] No such file or directory: '/nonexistent/first-build/.xarray_tutorial_data' │ │ │ │ +FileNotFoundError: [Errno 2] No such file or directory: '/nonexistent/second-build/.xarray_tutorial_data' │ │ │ │
│ │ │ │ │ │ │ │

The function we will apply is np.interp which expects 1D numpy arrays. This functionality is already implemented in xarray so we use that capability to make sure we are not making mistakes.

│ │ │ │
│ │ │ │
[2]:
│ │ │ │  
│ │ │ │
│ │ │ │ ├── html2text {} │ │ │ │ │ @@ -116,15 +116,15 @@ │ │ │ │ │ open_dataset(name, cache, cache_dir, github_url, branch, **kws) │ │ │ │ │ 76 # May want to add an option to remove it. │ │ │ │ │ 77 if not _os.path.isdir(longdir): │ │ │ │ │ ---> 78 _os.mkdir(longdir) │ │ │ │ │ 79 │ │ │ │ │ 80 url = "/".join((github_url, "raw", branch, fullname)) │ │ │ │ │ │ │ │ │ │ -FileNotFoundError: [Errno 2] No such file or directory: '/nonexistent/first- │ │ │ │ │ +FileNotFoundError: [Errno 2] No such file or directory: '/nonexistent/second- │ │ │ │ │ build/.xarray_tutorial_data' │ │ │ │ │ The function we will apply is np.interp which expects 1D numpy arrays. This │ │ │ │ │ functionality is already implemented in xarray so we use that capability to │ │ │ │ │ make sure we are not making mistakes. │ │ │ │ │ [2]: │ │ │ │ │ newlat = np.linspace(15, 75, 100) │ │ │ │ │ air.interp(lat=newlat) │ │ │ ├── ./usr/share/doc/python-xarray-doc/html/examples/apply_ufunc_vectorize_1d.ipynb.gz │ │ │ │ ├── apply_ufunc_vectorize_1d.ipynb │ │ │ │ │ ├── Pretty-printed │ │ │ │ │ │┄ Similarity: 0.9999510017421602% │ │ │ │ │ │┄ Differences: {"'cells'": '{2: {\'outputs\': {0: {\'evalue\': "[Errno 2] No such file or directory: ' │ │ │ │ │ │┄ '\'/nonexistent/second-build/.xarray_tutorial_data\'", \'traceback\': {insert: [(5, ' │ │ │ │ │ │┄ '"\\x1b[0;31mFileNotFoundError\\x1b[0m: [Errno 2] No such file or directory: ' │ │ │ │ │ │┄ '\'/nonexistent/second-build/.xarray_tutorial_data\'")], delete: [5]}}}}}'} │ │ │ │ │ │ @@ -39,23 +39,23 @@ │ │ │ │ │ │ "end_time": "2020-01-15T14:45:51.659160Z", │ │ │ │ │ │ "start_time": "2020-01-15T14:45:50.528742Z" │ │ │ │ │ │ } │ │ │ │ │ │ }, │ │ │ │ │ │ "outputs": [ │ │ │ │ │ │ { │ │ │ │ │ │ "ename": "FileNotFoundError", │ │ │ │ │ │ - "evalue": "[Errno 2] No such file or directory: '/nonexistent/first-build/.xarray_tutorial_data'", │ │ │ │ │ │ + "evalue": "[Errno 2] No such file or directory: '/nonexistent/second-build/.xarray_tutorial_data'", │ │ │ │ │ │ "output_type": "error", │ │ │ │ │ │ "traceback": [ │ │ │ │ │ │ "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", │ │ │ │ │ │ "\u001b[0;31mFileNotFoundError\u001b[0m Traceback (most recent call last)", │ │ │ │ │ │ "\u001b[0;32m\u001b[0m in \u001b[0;36m\u001b[0;34m\u001b[0m\n\u001b[1;32m 5\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 6\u001b[0m air = (\n\u001b[0;32m----> 7\u001b[0;31m \u001b[0mxr\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mtutorial\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mload_dataset\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m\"air_temperature\"\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 8\u001b[0m \u001b[0;34m.\u001b[0m\u001b[0mair\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0msortby\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m\"lat\"\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;31m# np.interp needs coordinate in ascending order\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 9\u001b[0m \u001b[0;34m.\u001b[0m\u001b[0misel\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mtime\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mslice\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;36m4\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mlon\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mslice\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;36m3\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", │ │ │ │ │ │ "\u001b[0;32m/build/reproducible-path/python-xarray-0.16.2/xarray/tutorial.py\u001b[0m in \u001b[0;36mload_dataset\u001b[0;34m(*args, **kwargs)\u001b[0m\n\u001b[1;32m 111\u001b[0m \u001b[0mopen_dataset\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 112\u001b[0m \"\"\"\n\u001b[0;32m--> 113\u001b[0;31m \u001b[0;32mwith\u001b[0m \u001b[0mopen_dataset\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m*\u001b[0m\u001b[0margs\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m**\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;32mas\u001b[0m \u001b[0mds\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 114\u001b[0m \u001b[0;32mreturn\u001b[0m \u001b[0mds\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mload\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 115\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n", │ │ │ │ │ │ "\u001b[0;32m/build/reproducible-path/python-xarray-0.16.2/xarray/tutorial.py\u001b[0m in \u001b[0;36mopen_dataset\u001b[0;34m(name, cache, cache_dir, github_url, branch, **kws)\u001b[0m\n\u001b[1;32m 76\u001b[0m \u001b[0;31m# May want to add an option to remove it.\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 77\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0;32mnot\u001b[0m \u001b[0m_os\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mpath\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0misdir\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mlongdir\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 78\u001b[0;31m \u001b[0m_os\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mmkdir\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mlongdir\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 79\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 80\u001b[0m \u001b[0murl\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;34m\"/\"\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mjoin\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mgithub_url\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m\"raw\"\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mbranch\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mfullname\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", │ │ │ │ │ │ - "\u001b[0;31mFileNotFoundError\u001b[0m: [Errno 2] No such file or directory: '/nonexistent/first-build/.xarray_tutorial_data'" │ │ │ │ │ │ + "\u001b[0;31mFileNotFoundError\u001b[0m: [Errno 2] No such file or directory: '/nonexistent/second-build/.xarray_tutorial_data'" │ │ │ │ │ │ ] │ │ │ │ │ │ } │ │ │ │ │ │ ], │ │ │ │ │ │ "source": [ │ │ │ │ │ │ "import xarray as xr\n", │ │ │ │ │ │ "import numpy as np\n", │ │ │ │ │ │ "\n", │ │ │ ├── ./usr/share/doc/python-xarray-doc/html/examples/area_weighted_temperature.html │ │ │ │ @@ -555,15 +555,15 @@ │ │ │ │ /build/reproducible-path/python-xarray-0.16.2/xarray/tutorial.py in open_dataset(name, cache, cache_dir, github_url, branch, **kws) │ │ │ │ 76 # May want to add an option to remove it. │ │ │ │ 77 if not _os.path.isdir(longdir): │ │ │ │ ---> 78 _os.mkdir(longdir) │ │ │ │ 79 │ │ │ │ 80 url = "/".join((github_url, "raw", branch, fullname)) │ │ │ │ │ │ │ │ -FileNotFoundError: [Errno 2] No such file or directory: '/nonexistent/first-build/.xarray_tutorial_data' │ │ │ │ +FileNotFoundError: [Errno 2] No such file or directory: '/nonexistent/second-build/.xarray_tutorial_data' │ │ │ │
│ │ │ │ │ │ │ │

Plot the first timestep:

│ │ │ │
│ │ │ │
[3]:
│ │ │ │  
│ │ │ │
│ │ │ │ ├── html2text {} │ │ │ │ │ @@ -113,15 +113,15 @@ │ │ │ │ │ open_dataset(name, cache, cache_dir, github_url, branch, **kws) │ │ │ │ │ 76 # May want to add an option to remove it. │ │ │ │ │ 77 if not _os.path.isdir(longdir): │ │ │ │ │ ---> 78 _os.mkdir(longdir) │ │ │ │ │ 79 │ │ │ │ │ 80 url = "/".join((github_url, "raw", branch, fullname)) │ │ │ │ │ │ │ │ │ │ -FileNotFoundError: [Errno 2] No such file or directory: '/nonexistent/first- │ │ │ │ │ +FileNotFoundError: [Errno 2] No such file or directory: '/nonexistent/second- │ │ │ │ │ build/.xarray_tutorial_data' │ │ │ │ │ Plot the first timestep: │ │ │ │ │ [3]: │ │ │ │ │ projection = ccrs.LambertConformal(central_longitude=-95, central_latitude=45) │ │ │ │ │ │ │ │ │ │ f, ax = plt.subplots(subplot_kw=dict(projection=projection)) │ │ │ ├── ./usr/share/doc/python-xarray-doc/html/examples/area_weighted_temperature.ipynb.gz │ │ │ │ ├── area_weighted_temperature.ipynb │ │ │ │ │ ├── Pretty-printed │ │ │ │ │ │┄ Similarity: 0.9998565051020408% │ │ │ │ │ │┄ Differences: {"'cells'": '{4: {\'outputs\': {0: {\'evalue\': "[Errno 2] No such file or directory: ' │ │ │ │ │ │┄ '\'/nonexistent/second-build/.xarray_tutorial_data\'", \'traceback\': {insert: [(5, ' │ │ │ │ │ │┄ '"\\x1b[0;31mFileNotFoundError\\x1b[0m: [Errno 2] No such file or directory: ' │ │ │ │ │ │┄ '\'/nonexistent/second-build/.xarray_tutorial_data\'")], delete: [5]}}}}}'} │ │ │ │ │ │ @@ -60,23 +60,23 @@ │ │ │ │ │ │ "end_time": "2020-03-17T14:43:57.831734Z", │ │ │ │ │ │ "start_time": "2020-03-17T14:43:57.651845Z" │ │ │ │ │ │ } │ │ │ │ │ │ }, │ │ │ │ │ │ "outputs": [ │ │ │ │ │ │ { │ │ │ │ │ │ "ename": "FileNotFoundError", │ │ │ │ │ │ - "evalue": "[Errno 2] No such file or directory: '/nonexistent/first-build/.xarray_tutorial_data'", │ │ │ │ │ │ + "evalue": "[Errno 2] No such file or directory: '/nonexistent/second-build/.xarray_tutorial_data'", │ │ │ │ │ │ "output_type": "error", │ │ │ │ │ │ "traceback": [ │ │ │ │ │ │ "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", │ │ │ │ │ │ "\u001b[0;31mFileNotFoundError\u001b[0m Traceback (most recent call last)", │ │ │ │ │ │ "\u001b[0;32m\u001b[0m in \u001b[0;36m\u001b[0;34m\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0mds\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mxr\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mtutorial\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mload_dataset\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m\"air_temperature\"\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 2\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 3\u001b[0m \u001b[0;31m# to celsius\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 4\u001b[0m \u001b[0mair\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mds\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mair\u001b[0m \u001b[0;34m-\u001b[0m \u001b[0;36m273.15\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 5\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n", │ │ │ │ │ │ "\u001b[0;32m/build/reproducible-path/python-xarray-0.16.2/xarray/tutorial.py\u001b[0m in \u001b[0;36mload_dataset\u001b[0;34m(*args, **kwargs)\u001b[0m\n\u001b[1;32m 111\u001b[0m \u001b[0mopen_dataset\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 112\u001b[0m \"\"\"\n\u001b[0;32m--> 113\u001b[0;31m \u001b[0;32mwith\u001b[0m \u001b[0mopen_dataset\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m*\u001b[0m\u001b[0margs\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m**\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;32mas\u001b[0m \u001b[0mds\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 114\u001b[0m \u001b[0;32mreturn\u001b[0m \u001b[0mds\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mload\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 115\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n", │ │ │ │ │ │ "\u001b[0;32m/build/reproducible-path/python-xarray-0.16.2/xarray/tutorial.py\u001b[0m in \u001b[0;36mopen_dataset\u001b[0;34m(name, cache, cache_dir, github_url, branch, **kws)\u001b[0m\n\u001b[1;32m 76\u001b[0m \u001b[0;31m# May want to add an option to remove it.\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 77\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0;32mnot\u001b[0m \u001b[0m_os\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mpath\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0misdir\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mlongdir\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 78\u001b[0;31m \u001b[0m_os\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mmkdir\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mlongdir\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 79\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 80\u001b[0m \u001b[0murl\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;34m\"/\"\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mjoin\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mgithub_url\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m\"raw\"\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mbranch\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mfullname\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", │ │ │ │ │ │ - "\u001b[0;31mFileNotFoundError\u001b[0m: [Errno 2] No such file or directory: '/nonexistent/first-build/.xarray_tutorial_data'" │ │ │ │ │ │ + "\u001b[0;31mFileNotFoundError\u001b[0m: [Errno 2] No such file or directory: '/nonexistent/second-build/.xarray_tutorial_data'" │ │ │ │ │ │ ] │ │ │ │ │ │ } │ │ │ │ │ │ ], │ │ │ │ │ │ "source": [ │ │ │ │ │ │ "ds = xr.tutorial.load_dataset(\"air_temperature\")\n", │ │ │ │ │ │ "\n", │ │ │ │ │ │ "# to celsius\n", │ │ │ ├── ./usr/share/doc/python-xarray-doc/html/examples/monthly-means.html │ │ │ │ @@ -528,15 +528,15 @@ │ │ │ │ /build/reproducible-path/python-xarray-0.16.2/xarray/tutorial.py in open_dataset(name, cache, cache_dir, github_url, branch, **kws) │ │ │ │ 76 # May want to add an option to remove it. │ │ │ │ 77 if not _os.path.isdir(longdir): │ │ │ │ ---> 78 _os.mkdir(longdir) │ │ │ │ 79 │ │ │ │ 80 url = "/".join((github_url, "raw", branch, fullname)) │ │ │ │ │ │ │ │ -FileNotFoundError: [Errno 2] No such file or directory: '/nonexistent/first-build/.xarray_tutorial_data' │ │ │ │ +FileNotFoundError: [Errno 2] No such file or directory: '/nonexistent/second-build/.xarray_tutorial_data' │ │ │ │
│ │ │ │ │ │ │ │ │ │ │ │
│ │ │ │

Now for the heavy lifting:

│ │ │ │

We first have to come up with the weights, - calculate the month lengths for each monthly data record - calculate weights using groupby('time.season')

│ │ │ │

Finally, we just need to multiply our weights by the Dataset and sum allong the time dimension. Creating a DataArray for the month length is as easy as using the days_in_month accessor on the time coordinate. The calendar type, in this case 'noleap', is automatically considered in this operation.

│ │ │ │ ├── html2text {} │ │ │ │ │ @@ -85,15 +85,15 @@ │ │ │ │ │ open_dataset(name, cache, cache_dir, github_url, branch, **kws) │ │ │ │ │ 76 # May want to add an option to remove it. │ │ │ │ │ 77 if not _os.path.isdir(longdir): │ │ │ │ │ ---> 78 _os.mkdir(longdir) │ │ │ │ │ 79 │ │ │ │ │ 80 url = "/".join((github_url, "raw", branch, fullname)) │ │ │ │ │ │ │ │ │ │ -FileNotFoundError: [Errno 2] No such file or directory: '/nonexistent/first- │ │ │ │ │ +FileNotFoundError: [Errno 2] No such file or directory: '/nonexistent/second- │ │ │ │ │ build/.xarray_tutorial_data' │ │ │ │ │ ***** Now for the heavy lifting:¶ ***** │ │ │ │ │ We first have to come up with the weights, - calculate the month lengths for │ │ │ │ │ each monthly data record - calculate weights using groupby('time.season') │ │ │ │ │ Finally, we just need to multiply our weights by the Dataset and sum allong the │ │ │ │ │ time dimension. Creating a DataArray for the month length is as easy as using │ │ │ │ │ the days_in_month accessor on the time coordinate. The calendar type, in this │ │ │ ├── ./usr/share/doc/python-xarray-doc/html/examples/monthly-means.ipynb.gz │ │ │ │ ├── monthly-means.ipynb │ │ │ │ │ ├── Pretty-printed │ │ │ │ │ │┄ Similarity: 0.999810606060606% │ │ │ │ │ │┄ Differences: {"'cells'": '{3: {\'outputs\': {0: {\'evalue\': "[Errno 2] No such file or directory: ' │ │ │ │ │ │┄ '\'/nonexistent/second-build/.xarray_tutorial_data\'", \'traceback\': {insert: [(4, ' │ │ │ │ │ │┄ '"\\x1b[0;31mFileNotFoundError\\x1b[0m: [Errno 2] No such file or directory: ' │ │ │ │ │ │┄ '\'/nonexistent/second-build/.xarray_tutorial_data\'")], delete: [4]}}}}}'} │ │ │ │ │ │ @@ -47,22 +47,22 @@ │ │ │ │ │ │ "end_time": "2018-11-28T20:51:36.072316Z", │ │ │ │ │ │ "start_time": "2018-11-28T20:51:36.016594Z" │ │ │ │ │ │ } │ │ │ │ │ │ }, │ │ │ │ │ │ "outputs": [ │ │ │ │ │ │ { │ │ │ │ │ │ "ename": "FileNotFoundError", │ │ │ │ │ │ - "evalue": "[Errno 2] No such file or directory: '/nonexistent/first-build/.xarray_tutorial_data'", │ │ │ │ │ │ + "evalue": "[Errno 2] No such file or directory: '/nonexistent/second-build/.xarray_tutorial_data'", │ │ │ │ │ │ "output_type": "error", │ │ │ │ │ │ "traceback": [ │ │ │ │ │ │ "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", │ │ │ │ │ │ "\u001b[0;31mFileNotFoundError\u001b[0m Traceback (most recent call last)", │ │ │ │ │ │ "\u001b[0;32m\u001b[0m in \u001b[0;36m\u001b[0;34m\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0mds\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mxr\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mtutorial\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mopen_dataset\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m'rasm'\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mload\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 2\u001b[0m \u001b[0mds\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", │ │ │ │ │ │ "\u001b[0;32m/build/reproducible-path/python-xarray-0.16.2/xarray/tutorial.py\u001b[0m in \u001b[0;36mopen_dataset\u001b[0;34m(name, cache, cache_dir, github_url, branch, **kws)\u001b[0m\n\u001b[1;32m 76\u001b[0m \u001b[0;31m# May want to add an option to remove it.\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 77\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0;32mnot\u001b[0m \u001b[0m_os\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mpath\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0misdir\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mlongdir\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 78\u001b[0;31m \u001b[0m_os\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mmkdir\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mlongdir\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 79\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 80\u001b[0m \u001b[0murl\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;34m\"/\"\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mjoin\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mgithub_url\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m\"raw\"\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mbranch\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mfullname\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", │ │ │ │ │ │ - "\u001b[0;31mFileNotFoundError\u001b[0m: [Errno 2] No such file or directory: '/nonexistent/first-build/.xarray_tutorial_data'" │ │ │ │ │ │ + "\u001b[0;31mFileNotFoundError\u001b[0m: [Errno 2] No such file or directory: '/nonexistent/second-build/.xarray_tutorial_data'" │ │ │ │ │ │ ] │ │ │ │ │ │ } │ │ │ │ │ │ ], │ │ │ │ │ │ "source": [ │ │ │ │ │ │ "ds = xr.tutorial.open_dataset('rasm').load()\n", │ │ │ │ │ │ "ds" │ │ │ │ │ │ ] │ │ │ ├── ./usr/share/doc/python-xarray-doc/html/examples/multidimensional-coords.html │ │ │ │ @@ -527,15 +527,15 @@ │ │ │ │ /build/reproducible-path/python-xarray-0.16.2/xarray/tutorial.py in open_dataset(name, cache, cache_dir, github_url, branch, **kws) │ │ │ │ 76 # May want to add an option to remove it. │ │ │ │ 77 if not _os.path.isdir(longdir): │ │ │ │ ---> 78 _os.mkdir(longdir) │ │ │ │ 79 │ │ │ │ 80 url = "/".join((github_url, "raw", branch, fullname)) │ │ │ │ │ │ │ │ -FileNotFoundError: [Errno 2] No such file or directory: '/nonexistent/first-build/.xarray_tutorial_data' │ │ │ │ +FileNotFoundError: [Errno 2] No such file or directory: '/nonexistent/second-build/.xarray_tutorial_data' │ │ │ │
│ │ │ │ │ │ │ │

In this example, the logical coordinates are x and y, while the physical coordinates are xc and yc, which represent the latitudes and longitude of the data.

│ │ │ │
│ │ │ │
[3]:
│ │ │ │  
│ │ │ │
│ │ │ │ ├── html2text {} │ │ │ │ │ @@ -83,15 +83,15 @@ │ │ │ │ │ open_dataset(name, cache, cache_dir, github_url, branch, **kws) │ │ │ │ │ 76 # May want to add an option to remove it. │ │ │ │ │ 77 if not _os.path.isdir(longdir): │ │ │ │ │ ---> 78 _os.mkdir(longdir) │ │ │ │ │ 79 │ │ │ │ │ 80 url = "/".join((github_url, "raw", branch, fullname)) │ │ │ │ │ │ │ │ │ │ -FileNotFoundError: [Errno 2] No such file or directory: '/nonexistent/first- │ │ │ │ │ +FileNotFoundError: [Errno 2] No such file or directory: '/nonexistent/second- │ │ │ │ │ build/.xarray_tutorial_data' │ │ │ │ │ In this example, the logical coordinates are x and y, while the physical │ │ │ │ │ coordinates are xc and yc, which represent the latitudes and longitude of the │ │ │ │ │ data. │ │ │ │ │ [3]: │ │ │ │ │ print(ds.xc.attrs) │ │ │ │ │ print(ds.yc.attrs) │ │ │ ├── ./usr/share/doc/python-xarray-doc/html/examples/multidimensional-coords.ipynb.gz │ │ │ │ ├── multidimensional-coords.ipynb │ │ │ │ │ ├── Pretty-printed │ │ │ │ │ │┄ Similarity: 0.9998697916666667% │ │ │ │ │ │┄ Differences: {"'cells'": '{3: {\'outputs\': {0: {\'evalue\': "[Errno 2] No such file or directory: ' │ │ │ │ │ │┄ '\'/nonexistent/second-build/.xarray_tutorial_data\'", \'traceback\': {insert: [(4, ' │ │ │ │ │ │┄ '"\\x1b[0;31mFileNotFoundError\\x1b[0m: [Errno 2] No such file or directory: ' │ │ │ │ │ │┄ '\'/nonexistent/second-build/.xarray_tutorial_data\'")], delete: [4]}}}}}'} │ │ │ │ │ │ @@ -45,22 +45,22 @@ │ │ │ │ │ │ "end_time": "2018-11-28T20:50:13.629720Z", │ │ │ │ │ │ "start_time": "2018-11-28T20:50:13.484542Z" │ │ │ │ │ │ } │ │ │ │ │ │ }, │ │ │ │ │ │ "outputs": [ │ │ │ │ │ │ { │ │ │ │ │ │ "ename": "FileNotFoundError", │ │ │ │ │ │ - "evalue": "[Errno 2] No such file or directory: '/nonexistent/first-build/.xarray_tutorial_data'", │ │ │ │ │ │ + "evalue": "[Errno 2] No such file or directory: '/nonexistent/second-build/.xarray_tutorial_data'", │ │ │ │ │ │ "output_type": "error", │ │ │ │ │ │ "traceback": [ │ │ │ │ │ │ "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", │ │ │ │ │ │ "\u001b[0;31mFileNotFoundError\u001b[0m Traceback (most recent call last)", │ │ │ │ │ │ "\u001b[0;32m\u001b[0m in \u001b[0;36m\u001b[0;34m\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0mds\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mxr\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mtutorial\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mopen_dataset\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m'rasm'\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mload\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 2\u001b[0m \u001b[0mds\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", │ │ │ │ │ │ "\u001b[0;32m/build/reproducible-path/python-xarray-0.16.2/xarray/tutorial.py\u001b[0m in \u001b[0;36mopen_dataset\u001b[0;34m(name, cache, cache_dir, github_url, branch, **kws)\u001b[0m\n\u001b[1;32m 76\u001b[0m \u001b[0;31m# May want to add an option to remove it.\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 77\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0;32mnot\u001b[0m \u001b[0m_os\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mpath\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0misdir\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mlongdir\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 78\u001b[0;31m \u001b[0m_os\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mmkdir\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mlongdir\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 79\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 80\u001b[0m \u001b[0murl\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;34m\"/\"\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mjoin\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mgithub_url\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m\"raw\"\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mbranch\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mfullname\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", │ │ │ │ │ │ - "\u001b[0;31mFileNotFoundError\u001b[0m: [Errno 2] No such file or directory: '/nonexistent/first-build/.xarray_tutorial_data'" │ │ │ │ │ │ + "\u001b[0;31mFileNotFoundError\u001b[0m: [Errno 2] No such file or directory: '/nonexistent/second-build/.xarray_tutorial_data'" │ │ │ │ │ │ ] │ │ │ │ │ │ } │ │ │ │ │ │ ], │ │ │ │ │ │ "source": [ │ │ │ │ │ │ "ds = xr.tutorial.open_dataset('rasm').load()\n", │ │ │ │ │ │ "ds" │ │ │ │ │ │ ] │ │ │ ├── ./usr/share/doc/python-xarray-doc/html/examples/visualization_gallery.html │ │ │ │ @@ -533,15 +533,15 @@ │ │ │ │ /build/reproducible-path/python-xarray-0.16.2/xarray/tutorial.py in open_dataset(name, cache, cache_dir, github_url, branch, **kws) │ │ │ │ 76 # May want to add an option to remove it. │ │ │ │ 77 if not _os.path.isdir(longdir): │ │ │ │ ---> 78 _os.mkdir(longdir) │ │ │ │ 79 │ │ │ │ 80 url = "/".join((github_url, "raw", branch, fullname)) │ │ │ │ │ │ │ │ -FileNotFoundError: [Errno 2] No such file or directory: '/nonexistent/first-build/.xarray_tutorial_data' │ │ │ │ +FileNotFoundError: [Errno 2] No such file or directory: '/nonexistent/second-build/.xarray_tutorial_data' │ │ │ │
│ │ │ │ │ │ │ │
│ │ │ │

Multiple plots and map projections

│ │ │ │

Control the map projection parameters on multiple axes

│ │ │ │

This example illustrates how to plot multiple maps and control their extent and aspect ratio.

│ │ │ │

For more details see this discussion on github.

│ │ │ │ @@ -770,15 +770,15 @@ │ │ │ │ 200 except KeyError: │ │ │ │ │ │ │ │ /build/reproducible-path/python-xarray-0.16.2/xarray/backends/lru_cache.py in __getitem__(self, key) │ │ │ │ 52 with self._lock: │ │ │ │ ---> 53 value = self._cache[key] │ │ │ │ 54 self._cache.move_to_end(key) │ │ │ │ │ │ │ │ -KeyError: [<function open at 0xe9089bf8>, ('https://github.com/mapbox/rasterio/raw/master/tests/data/RGB.byte.tif',), 'r', ()] │ │ │ │ +KeyError: [<function open at 0xa83ffbf8>, ('https://github.com/mapbox/rasterio/raw/master/tests/data/RGB.byte.tif',), 'r', ()] │ │ │ │ │ │ │ │ During handling of the above exception, another exception occurred: │ │ │ │ │ │ │ │ CPLE_HttpResponseError Traceback (most recent call last) │ │ │ │ rasterio/_base.pyx in rasterio._base.DatasetBase.__init__() │ │ │ │ │ │ │ │ rasterio/_shim.pyx in rasterio._shim.open_dataset() │ │ │ │ @@ -889,15 +889,15 @@ │ │ │ │ 200 except KeyError: │ │ │ │ │ │ │ │ /build/reproducible-path/python-xarray-0.16.2/xarray/backends/lru_cache.py in __getitem__(self, key) │ │ │ │ 52 with self._lock: │ │ │ │ ---> 53 value = self._cache[key] │ │ │ │ 54 self._cache.move_to_end(key) │ │ │ │ │ │ │ │ -KeyError: [<function open at 0xe9089bf8>, ('https://github.com/mapbox/rasterio/raw/master/tests/data/RGB.byte.tif',), 'r', ()] │ │ │ │ +KeyError: [<function open at 0xa83ffbf8>, ('https://github.com/mapbox/rasterio/raw/master/tests/data/RGB.byte.tif',), 'r', ()] │ │ │ │ │ │ │ │ During handling of the above exception, another exception occurred: │ │ │ │ │ │ │ │ CPLE_OpenFailedError Traceback (most recent call last) │ │ │ │ rasterio/_base.pyx in rasterio._base.DatasetBase.__init__() │ │ │ │ │ │ │ │ rasterio/_shim.pyx in rasterio._shim.open_dataset() │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -89,15 +89,15 @@ │ │ │ │ │ open_dataset(name, cache, cache_dir, github_url, branch, **kws) │ │ │ │ │ 76 # May want to add an option to remove it. │ │ │ │ │ 77 if not _os.path.isdir(longdir): │ │ │ │ │ ---> 78 _os.mkdir(longdir) │ │ │ │ │ 79 │ │ │ │ │ 80 url = "/".join((github_url, "raw", branch, fullname)) │ │ │ │ │ │ │ │ │ │ -FileNotFoundError: [Errno 2] No such file or directory: '/nonexistent/first- │ │ │ │ │ +FileNotFoundError: [Errno 2] No such file or directory: '/nonexistent/second- │ │ │ │ │ build/.xarray_tutorial_data' │ │ │ │ │ ***** Multiple plots and map projections¶ ***** │ │ │ │ │ Control the map projection parameters on multiple axes │ │ │ │ │ This example illustrates how to plot multiple maps and control their extent and │ │ │ │ │ aspect ratio. │ │ │ │ │ For more details see this_discussion on github. │ │ │ │ │ [3]: │ │ │ │ │ @@ -255,15 +255,15 @@ │ │ │ │ │ │ │ │ │ │ /build/reproducible-path/python-xarray-0.16.2/xarray/backends/lru_cache.py in │ │ │ │ │ __getitem__(self, key) │ │ │ │ │ 52 with self._lock: │ │ │ │ │ ---> 53 value = self._cache[key] │ │ │ │ │ 54 self._cache.move_to_end(key) │ │ │ │ │ │ │ │ │ │ -KeyError: [, ('https://github.com/mapbox/rasterio/ │ │ │ │ │ +KeyError: [, ('https://github.com/mapbox/rasterio/ │ │ │ │ │ raw/master/tests/data/RGB.byte.tif',), 'r', ()] │ │ │ │ │ │ │ │ │ │ During handling of the above exception, another exception occurred: │ │ │ │ │ │ │ │ │ │ CPLE_HttpResponseError Traceback (most recent call last) │ │ │ │ │ rasterio/_base.pyx in rasterio._base.DatasetBase.__init__() │ │ │ │ │ │ │ │ │ │ @@ -374,15 +374,15 @@ │ │ │ │ │ │ │ │ │ │ /build/reproducible-path/python-xarray-0.16.2/xarray/backends/lru_cache.py in │ │ │ │ │ __getitem__(self, key) │ │ │ │ │ 52 with self._lock: │ │ │ │ │ ---> 53 value = self._cache[key] │ │ │ │ │ 54 self._cache.move_to_end(key) │ │ │ │ │ │ │ │ │ │ -KeyError: [, ('https://github.com/mapbox/rasterio/ │ │ │ │ │ +KeyError: [, ('https://github.com/mapbox/rasterio/ │ │ │ │ │ raw/master/tests/data/RGB.byte.tif',), 'r', ()] │ │ │ │ │ │ │ │ │ │ During handling of the above exception, another exception occurred: │ │ │ │ │ │ │ │ │ │ CPLE_OpenFailedError Traceback (most recent call last) │ │ │ │ │ rasterio/_base.pyx in rasterio._base.DatasetBase.__init__() │ │ │ ├── ./usr/share/doc/python-xarray-doc/html/examples/visualization_gallery.ipynb.gz │ │ │ │ ├── visualization_gallery.ipynb │ │ │ │ │ ├── Pretty-printed │ │ │ │ │ │┄ Similarity: 0.9998566862824675% │ │ │ │ │ │┄ Differences: {"'cells'": '{3: {\'outputs\': {0: {\'evalue\': "[Errno 2] No such file or directory: ' │ │ │ │ │ │┄ '\'/nonexistent/second-build/.xarray_tutorial_data\'", \'traceback\': {insert: [(5, ' │ │ │ │ │ │┄ '"\\x1b[0;31mFileNotFoundError\\x1b[0m: [Errno 2] No such file or directory: ' │ │ │ │ │ │┄ '\'/nonexistent/second-build/.xarray_tutorial_data\'")], delete: [5]}}}}, 13: ' │ │ │ │ │ │┄ '{\'outputs\': {0: {\'traceback\': {insert: [(4, "\\x1b[0;31mKeyError\\x1b[0m: ' │ │ │ │ │ │┄ '[, ' │ │ │ │ │ │┄ […] │ │ │ │ │ │ @@ -31,23 +31,23 @@ │ │ │ │ │ │ { │ │ │ │ │ │ "cell_type": "code", │ │ │ │ │ │ "execution_count": 2, │ │ │ │ │ │ "metadata": {}, │ │ │ │ │ │ "outputs": [ │ │ │ │ │ │ { │ │ │ │ │ │ "ename": "FileNotFoundError", │ │ │ │ │ │ - "evalue": "[Errno 2] No such file or directory: '/nonexistent/first-build/.xarray_tutorial_data'", │ │ │ │ │ │ + "evalue": "[Errno 2] No such file or directory: '/nonexistent/second-build/.xarray_tutorial_data'", │ │ │ │ │ │ "output_type": "error", │ │ │ │ │ │ "traceback": [ │ │ │ │ │ │ "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", │ │ │ │ │ │ "\u001b[0;31mFileNotFoundError\u001b[0m Traceback (most recent call last)", │ │ │ │ │ │ "\u001b[0;32m\u001b[0m in \u001b[0;36m\u001b[0;34m\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0mds\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mxr\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mtutorial\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mload_dataset\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m'air_temperature'\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m", │ │ │ │ │ │ "\u001b[0;32m/build/reproducible-path/python-xarray-0.16.2/xarray/tutorial.py\u001b[0m in \u001b[0;36mload_dataset\u001b[0;34m(*args, **kwargs)\u001b[0m\n\u001b[1;32m 111\u001b[0m \u001b[0mopen_dataset\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 112\u001b[0m \"\"\"\n\u001b[0;32m--> 113\u001b[0;31m \u001b[0;32mwith\u001b[0m \u001b[0mopen_dataset\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m*\u001b[0m\u001b[0margs\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m**\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;32mas\u001b[0m \u001b[0mds\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 114\u001b[0m \u001b[0;32mreturn\u001b[0m \u001b[0mds\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mload\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 115\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n", │ │ │ │ │ │ "\u001b[0;32m/build/reproducible-path/python-xarray-0.16.2/xarray/tutorial.py\u001b[0m in \u001b[0;36mopen_dataset\u001b[0;34m(name, cache, cache_dir, github_url, branch, **kws)\u001b[0m\n\u001b[1;32m 76\u001b[0m \u001b[0;31m# May want to add an option to remove it.\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 77\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0;32mnot\u001b[0m \u001b[0m_os\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mpath\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0misdir\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mlongdir\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 78\u001b[0;31m \u001b[0m_os\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mmkdir\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mlongdir\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 79\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 80\u001b[0m \u001b[0murl\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;34m\"/\"\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mjoin\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mgithub_url\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m\"raw\"\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mbranch\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mfullname\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", │ │ │ │ │ │ - "\u001b[0;31mFileNotFoundError\u001b[0m: [Errno 2] No such file or directory: '/nonexistent/first-build/.xarray_tutorial_data'" │ │ │ │ │ │ + "\u001b[0;31mFileNotFoundError\u001b[0m: [Errno 2] No such file or directory: '/nonexistent/second-build/.xarray_tutorial_data'" │ │ │ │ │ │ ] │ │ │ │ │ │ } │ │ │ │ │ │ ], │ │ │ │ │ │ "source": [ │ │ │ │ │ │ "ds = xr.tutorial.load_dataset('air_temperature')" │ │ │ │ │ │ ] │ │ │ │ │ │ }, │ │ │ │ │ │ @@ -275,15 +275,15 @@ │ │ │ │ │ │ "evalue": "CURL error: Could not resolve host: github.com", │ │ │ │ │ │ "output_type": "error", │ │ │ │ │ │ "traceback": [ │ │ │ │ │ │ "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", │ │ │ │ │ │ "\u001b[0;31mKeyError\u001b[0m Traceback (most recent call last)", │ │ │ │ │ │ "\u001b[0;32m/build/reproducible-path/python-xarray-0.16.2/xarray/backends/file_manager.py\u001b[0m in \u001b[0;36m_acquire_with_cache_info\u001b[0;34m(self, needs_lock)\u001b[0m\n\u001b[1;32m 198\u001b[0m \u001b[0;32mtry\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 199\u001b[0;31m \u001b[0mfile\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_cache\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_key\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 200\u001b[0m \u001b[0;32mexcept\u001b[0m \u001b[0mKeyError\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", │ │ │ │ │ │ "\u001b[0;32m/build/reproducible-path/python-xarray-0.16.2/xarray/backends/lru_cache.py\u001b[0m in \u001b[0;36m__getitem__\u001b[0;34m(self, key)\u001b[0m\n\u001b[1;32m 52\u001b[0m \u001b[0;32mwith\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_lock\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 53\u001b[0;31m \u001b[0mvalue\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_cache\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mkey\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 54\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_cache\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mmove_to_end\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mkey\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", │ │ │ │ │ │ - "\u001b[0;31mKeyError\u001b[0m: [, ('https://github.com/mapbox/rasterio/raw/master/tests/data/RGB.byte.tif',), 'r', ()]", │ │ │ │ │ │ + "\u001b[0;31mKeyError\u001b[0m: [, ('https://github.com/mapbox/rasterio/raw/master/tests/data/RGB.byte.tif',), 'r', ()]", │ │ │ │ │ │ "\nDuring handling of the above exception, another exception occurred:\n", │ │ │ │ │ │ "\u001b[0;31mCPLE_HttpResponseError\u001b[0m Traceback (most recent call last)", │ │ │ │ │ │ "\u001b[0;32mrasterio/_base.pyx\u001b[0m in \u001b[0;36mrasterio._base.DatasetBase.__init__\u001b[0;34m()\u001b[0m\n", │ │ │ │ │ │ "\u001b[0;32mrasterio/_shim.pyx\u001b[0m in \u001b[0;36mrasterio._shim.open_dataset\u001b[0;34m()\u001b[0m\n", │ │ │ │ │ │ "\u001b[0;32mrasterio/_err.pyx\u001b[0m in \u001b[0;36mrasterio._err.exc_wrap_pointer\u001b[0;34m()\u001b[0m\n", │ │ │ │ │ │ "\u001b[0;31mCPLE_HttpResponseError\u001b[0m: CURL error: Could not resolve host: github.com", │ │ │ │ │ │ "\nDuring handling of the above exception, another exception occurred:\n", │ │ │ │ │ │ @@ -338,15 +338,15 @@ │ │ │ │ │ │ "evalue": "'/vsicurl/https://github.com/mapbox/rasterio/raw/master/tests/data/RGB.byte.tif' does not exist in the file system, and is not recognized as a supported dataset name.", │ │ │ │ │ │ "output_type": "error", │ │ │ │ │ │ "traceback": [ │ │ │ │ │ │ "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", │ │ │ │ │ │ "\u001b[0;31mKeyError\u001b[0m Traceback (most recent call last)", │ │ │ │ │ │ "\u001b[0;32m/build/reproducible-path/python-xarray-0.16.2/xarray/backends/file_manager.py\u001b[0m in \u001b[0;36m_acquire_with_cache_info\u001b[0;34m(self, needs_lock)\u001b[0m\n\u001b[1;32m 198\u001b[0m \u001b[0;32mtry\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 199\u001b[0;31m \u001b[0mfile\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_cache\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_key\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 200\u001b[0m \u001b[0;32mexcept\u001b[0m \u001b[0mKeyError\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", │ │ │ │ │ │ "\u001b[0;32m/build/reproducible-path/python-xarray-0.16.2/xarray/backends/lru_cache.py\u001b[0m in \u001b[0;36m__getitem__\u001b[0;34m(self, key)\u001b[0m\n\u001b[1;32m 52\u001b[0m \u001b[0;32mwith\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_lock\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 53\u001b[0;31m \u001b[0mvalue\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_cache\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mkey\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 54\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_cache\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mmove_to_end\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mkey\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", │ │ │ │ │ │ - "\u001b[0;31mKeyError\u001b[0m: [, ('https://github.com/mapbox/rasterio/raw/master/tests/data/RGB.byte.tif',), 'r', ()]", │ │ │ │ │ │ + "\u001b[0;31mKeyError\u001b[0m: [, ('https://github.com/mapbox/rasterio/raw/master/tests/data/RGB.byte.tif',), 'r', ()]", │ │ │ │ │ │ "\nDuring handling of the above exception, another exception occurred:\n", │ │ │ │ │ │ "\u001b[0;31mCPLE_OpenFailedError\u001b[0m Traceback (most recent call last)", │ │ │ │ │ │ "\u001b[0;32mrasterio/_base.pyx\u001b[0m in \u001b[0;36mrasterio._base.DatasetBase.__init__\u001b[0;34m()\u001b[0m\n", │ │ │ │ │ │ "\u001b[0;32mrasterio/_shim.pyx\u001b[0m in \u001b[0;36mrasterio._shim.open_dataset\u001b[0;34m()\u001b[0m\n", │ │ │ │ │ │ "\u001b[0;32mrasterio/_err.pyx\u001b[0m in \u001b[0;36mrasterio._err.exc_wrap_pointer\u001b[0;34m()\u001b[0m\n", │ │ │ │ │ │ "\u001b[0;31mCPLE_OpenFailedError\u001b[0m: '/vsicurl/https://github.com/mapbox/rasterio/raw/master/tests/data/RGB.byte.tif' does not exist in the file system, and is not recognized as a supported dataset name.", │ │ │ │ │ │ "\nDuring handling of the above exception, another exception occurred:\n", │ │ │ ├── ./usr/share/doc/python-xarray-doc/html/examples/weather-data.html │ │ │ │ @@ -889,30 +889,30 @@ │ │ │ │
<xarray.Dataset>
│ │ │ │  Dimensions:   (location: 3, time: 731)
│ │ │ │  Coordinates:
│ │ │ │    * time      (time) datetime64[ns] 2000-01-01 2000-01-02 ... 2001-12-31
│ │ │ │    * location  (location) <U2 'IA' 'IN' 'IL'
│ │ │ │  Data variables:
│ │ │ │      tmin      (time, location) float64 -8.037 -1.788 -3.932 ... -1.346 -4.544
│ │ │ │ -    tmax      (time, location) float64 12.98 3.31 6.779 ... 6.636 3.343 3.805
  • │ │ │ │ │ │ │ │
    │ │ │ │

    Examine a dataset with pandas and seaborn

    │ │ │ │
    │ │ │ │

    Convert to a pandas DataFrame

    │ │ │ │
    │ │ │ │
    [2]:
    │ │ │ │ @@ -1112,15 +1112,15 @@
    │ │ │ │  
    │ │ │ │
    │ │ │ │
    [5]:
    │ │ │ │  
    │ │ │ │
    │ │ │ │
    │ │ │ │
    │ │ │ │ -<seaborn.axisgrid.PairGrid at 0xf51e8838>
    │ │ │ │ +<seaborn.axisgrid.PairGrid at 0xb41db820>
    │ │ │ │  
    │ │ │ │
    │ │ │ │
    │ │ │ │
    │ │ │ │
    │ │ │ │
    │ │ │ │ ../_images/examples_weather-data_9_1.png │ │ │ │ @@ -1507,26 +1507,26 @@ │ │ │ │ [0. , 0. , 0. ], │ │ │ │ [0. , 0. , 0. ], │ │ │ │ [0. , 0.01612903, 0. ], │ │ │ │ [0.33333333, 0.35 , 0.23333333], │ │ │ │ [0.93548387, 0.85483871, 0.82258065]]) │ │ │ │ Coordinates: │ │ │ │ * location (location) <U2 'IA' 'IN' 'IL' │ │ │ │ - * month (month) int64 1 2 3 4 5 6 7 8 9 10 11 12
    • location
      (location)
      <U2
      'IA' 'IN' 'IL'
      array(['IA', 'IN', 'IL'], dtype='<U2')
    • month
      (month)
      int64
      1 2 3 4 5 6 7 8 9 10 11 12
      array([ 1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12], dtype=int64)
  • │ │ │ │
    │ │ │ │
    │ │ │ │
    [7]:
    │ │ │ │  
    │ │ │ │
    │ │ │ │
    │ │ │ │  freeze.to_pandas().plot()
    │ │ │ │ @@ -2025,18 +2025,18 @@
    │ │ │ │  Dimensions:       (location: 3, time: 731)
    │ │ │ │  Coordinates:
    │ │ │ │    * time          (time) datetime64[ns] 2000-01-01 2000-01-02 ... 2001-12-31
    │ │ │ │    * location      (location) object 'IA' 'IN' 'IL'
    │ │ │ │      month         (time) int64 1 1 1 1 1 1 1 1 1 ... 12 12 12 12 12 12 12 12 12
    │ │ │ │  Data variables:
    │ │ │ │      some_missing  (time, location) float64 nan nan nan ... 2.063 -1.346 -4.544
    │ │ │ │ -    filled        (time, location) float64 -5.163 -4.216 ... -1.346 -4.544
  • │ │ │ │ │ │ │ │
    │ │ │ │
    [12]:
    │ │ │ │  
    │ │ │ │
    │ │ │ │
    │ │ │ │  df = both.sel(time="2000").mean("location").reset_coords(drop=True).to_dataframe()
    │ │ │ │ ├── html2text {}
    │ │ │ │ │ @@ -188,15 +188,15 @@
    │ │ │ │ │  [4]:
    │ │ │ │ │  
    │ │ │ │ │  [../_images/examples_weather-data_7_1.png]
    │ │ │ │ │  **** Visualize using seaborn¶ ****
    │ │ │ │ │  [5]:
    │ │ │ │ │  sns.pairplot(df.reset_index(), vars=ds.data_vars)
    │ │ │ │ │  [5]:
    │ │ │ │ │ -
    │ │ │ │ │ +
    │ │ │ │ │  [../_images/examples_weather-data_9_1.png]
    │ │ │ │ │  ***** Probability of freeze by calendar month¶ *****
    │ │ │ │ │  [6]:
    │ │ │ │ │  freeze = (ds["tmin"] <= 0).groupby("time.month").mean("time")
    │ │ │ │ │  freeze
    │ │ │ │ │  [6]:
    │ │ │ ├── ./usr/share/doc/python-xarray-doc/html/examples/weather-data.ipynb.gz
    │ │ │ │ ├── weather-data.ipynb
    │ │ │ │ │ ├── Pretty-printed
    │ │ │ │ │ │┄ Similarity: 0.999984729458033%
    │ │ │ │ │ │┄ Differences: {"'cells'": '{1: {\'outputs\': {0: {\'data\': {\'text/html\': {insert: [(358, "    tmax      '
    │ │ │ │ │ │┄             '(time, location) float64 12.98 3.31 6.779 ... 6.636 3.343 3.805
    " │ │ │ │ │ │ ], │ │ │ │ │ │ "text/plain": [ │ │ │ │ │ │ "\n", │ │ │ │ │ │ "Dimensions: (location: 3, time: 731)\n", │ │ │ │ │ │ "Coordinates:\n", │ │ │ │ │ │ " * time (time) datetime64[ns] 2000-01-01 2000-01-02 ... 2001-12-31\n", │ │ │ │ │ │ " * location (location) " │ │ │ │ │ │ + "" │ │ │ │ │ │ ] │ │ │ │ │ │ }, │ │ │ │ │ │ "execution_count": 5, │ │ │ │ │ │ "metadata": {}, │ │ │ │ │ │ "output_type": "execute_result" │ │ │ │ │ │ }, │ │ │ │ │ │ { │ │ │ │ │ │ @@ -1121,26 +1121,26 @@ │ │ │ │ │ │ " [0. , 0. , 0. ],\n", │ │ │ │ │ │ " [0. , 0. , 0. ],\n", │ │ │ │ │ │ " [0. , 0.01612903, 0. ],\n", │ │ │ │ │ │ " [0.33333333, 0.35 , 0.23333333],\n", │ │ │ │ │ │ " [0.93548387, 0.85483871, 0.82258065]])\n", │ │ │ │ │ │ "Coordinates:\n", │ │ │ │ │ │ " * location (location) <U2 'IA' 'IN' 'IL'\n", │ │ │ │ │ │ - " * month (month) int64 1 2 3 4 5 6 7 8 9 10 11 12
    • location
      (location)
      <U2
      'IA' 'IN' 'IL'
      array(['IA', 'IN', 'IL'], dtype='<U2')
    • month
      (month)
      int64
      1 2 3 4 5 6 7 8 9 10 11 12
      array([ 1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12], dtype=int64)
  • " │ │ │ │ │ │ ], │ │ │ │ │ │ "text/plain": [ │ │ │ │ │ │ "\n", │ │ │ │ │ │ "array([[0.9516129 , 0.88709677, 0.93548387],\n", │ │ │ │ │ │ " [0.84210526, 0.71929825, 0.77192982],\n", │ │ │ │ │ │ " [0.24193548, 0.12903226, 0.16129032],\n", │ │ │ │ │ │ " [0. , 0. , 0. ],\n", │ │ │ │ │ │ @@ -1760,18 +1760,18 @@ │ │ │ │ │ │ "Dimensions: (location: 3, time: 731)\n", │ │ │ │ │ │ "Coordinates:\n", │ │ │ │ │ │ " * time (time) datetime64[ns] 2000-01-01 2000-01-02 ... 2001-12-31\n", │ │ │ │ │ │ " * location (location) object 'IA' 'IN' 'IL'\n", │ │ │ │ │ │ " month (time) int64 1 1 1 1 1 1 1 1 1 ... 12 12 12 12 12 12 12 12 12\n", │ │ │ │ │ │ "Data variables:\n", │ │ │ │ │ │ " some_missing (time, location) float64 nan nan nan ... 2.063 -1.346 -4.544\n", │ │ │ │ │ │ - " filled (time, location) float64 -5.163 -4.216 ... -1.346 -4.544
  • " │ │ │ │ │ │ ], │ │ │ │ │ │ "text/plain": [ │ │ │ │ │ │ "\n", │ │ │ │ │ │ "Dimensions: (location: 3, time: 731)\n", │ │ │ │ │ │ "Coordinates:\n", │ │ │ │ │ │ " * time (time) datetime64[ns] 2000-01-01 2000-01-02 ... 2001-12-31\n", │ │ │ │ │ │ " * location (location) object 'IA' 'IN' 'IL'\n", │ │ │ ├── ./usr/share/doc/python-xarray-doc/html/indexing.html │ │ │ │ @@ -875,15 +875,15 @@ │ │ │ │ /build/reproducible-path/python-xarray-0.16.2/xarray/tutorial.py in open_dataset(name, cache, cache_dir, github_url, branch, **kws) │ │ │ │ 76 # May want to add an option to remove it. │ │ │ │ 77 if not _os.path.isdir(longdir): │ │ │ │ ---> 78 _os.mkdir(longdir) │ │ │ │ 79 │ │ │ │ 80 url = "/".join((github_url, "raw", branch, fullname)) │ │ │ │ │ │ │ │ -FileNotFoundError: [Errno 2] No such file or directory: '/nonexistent/first-build/.xarray_tutorial_data' │ │ │ │ +FileNotFoundError: [Errno 2] No such file or directory: '/nonexistent/second-build/.xarray_tutorial_data' │ │ │ │ │ │ │ │ # add an empty 2D dataarray │ │ │ │ In [54]: ds["empty"] = xr.full_like(ds.air.mean("time"), fill_value=0) │ │ │ │ --------------------------------------------------------------------------- │ │ │ │ AttributeError Traceback (most recent call last) │ │ │ │ <ipython-input-54-6709edaff03d> in <module> │ │ │ │ ----> 1 ds["empty"] = xr.full_like(ds.air.mean("time"), fill_value=0) │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -563,15 +563,15 @@ │ │ │ │ │ open_dataset(name, cache, cache_dir, github_url, branch, **kws) │ │ │ │ │ 76 # May want to add an option to remove it. │ │ │ │ │ 77 if not _os.path.isdir(longdir): │ │ │ │ │ ---> 78 _os.mkdir(longdir) │ │ │ │ │ 79 │ │ │ │ │ 80 url = "/".join((github_url, "raw", branch, fullname)) │ │ │ │ │ │ │ │ │ │ -FileNotFoundError: [Errno 2] No such file or directory: '/nonexistent/first- │ │ │ │ │ +FileNotFoundError: [Errno 2] No such file or directory: '/nonexistent/second- │ │ │ │ │ build/.xarray_tutorial_data' │ │ │ │ │ │ │ │ │ │ # add an empty 2D dataarray │ │ │ │ │ In [54]: ds["empty"] = xr.full_like(ds.air.mean("time"), fill_value=0) │ │ │ │ │ --------------------------------------------------------------------------- │ │ │ │ │ AttributeError Traceback (most recent call last) │ │ │ │ │ in │ │ │ ├── ./usr/share/doc/python-xarray-doc/html/internals.html │ │ │ │ @@ -431,18 +431,18 @@ │ │ │ │ /build/reproducible-path/python-xarray-0.16.2/xarray/tutorial.py in open_dataset(name, cache, cache_dir, github_url, branch, **kws) │ │ │ │ 76 # May want to add an option to remove it. │ │ │ │ 77 if not _os.path.isdir(longdir): │ │ │ │ ---> 78 _os.mkdir(longdir) │ │ │ │ 79 │ │ │ │ 80 url = "/".join((github_url, "raw", branch, fullname)) │ │ │ │ │ │ │ │ -FileNotFoundError: [Errno 2] No such file or directory: '/nonexistent/first-build/.xarray_tutorial_data' │ │ │ │ +FileNotFoundError: [Errno 2] No such file or directory: '/nonexistent/second-build/.xarray_tutorial_data' │ │ │ │ │ │ │ │ In [5]: ds.to_zarr("rasm.zarr", mode="w") │ │ │ │ -Out[5]: <xarray.backends.zarr.ZarrStore at 0xe55e2ce8> │ │ │ │ +Out[5]: <xarray.backends.zarr.ZarrStore at 0xa4bc6ce8> │ │ │ │ │ │ │ │ In [6]: import zarr │ │ │ │ │ │ │ │ In [7]: zgroup = zarr.open("rasm.zarr") │ │ │ │ │ │ │ │ In [8]: print(zgroup.tree()) │ │ │ │ / │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -225,19 +225,19 @@ │ │ │ │ │ open_dataset(name, cache, cache_dir, github_url, branch, **kws) │ │ │ │ │ 76 # May want to add an option to remove it. │ │ │ │ │ 77 if not _os.path.isdir(longdir): │ │ │ │ │ ---> 78 _os.mkdir(longdir) │ │ │ │ │ 79 │ │ │ │ │ 80 url = "/".join((github_url, "raw", branch, fullname)) │ │ │ │ │ │ │ │ │ │ -FileNotFoundError: [Errno 2] No such file or directory: '/nonexistent/first- │ │ │ │ │ +FileNotFoundError: [Errno 2] No such file or directory: '/nonexistent/second- │ │ │ │ │ build/.xarray_tutorial_data' │ │ │ │ │ │ │ │ │ │ In [5]: ds.to_zarr("rasm.zarr", mode="w") │ │ │ │ │ -Out[5]: │ │ │ │ │ +Out[5]: │ │ │ │ │ │ │ │ │ │ In [6]: import zarr │ │ │ │ │ │ │ │ │ │ In [7]: zgroup = zarr.open("rasm.zarr") │ │ │ │ │ │ │ │ │ │ In [8]: print(zgroup.tree()) │ │ │ │ │ / │ │ │ ├── ./usr/share/doc/python-xarray-doc/html/interpolation.html │ │ │ │ @@ -408,24 +408,24 @@ │ │ │ │ ....: np.sin(np.linspace(0, 2 * np.pi, 10)), │ │ │ │ ....: dims="x", │ │ │ │ ....: coords={"x": np.linspace(0, 1, 10)}, │ │ │ │ ....: ) │ │ │ │ ....: │ │ │ │ │ │ │ │ In [17]: da.plot.line("o", label="original") │ │ │ │ -Out[17]: [<matplotlib.lines.Line2D at 0xe55b8b68>] │ │ │ │ +Out[17]: [<matplotlib.lines.Line2D at 0xa8148eb0>] │ │ │ │ │ │ │ │ In [18]: da.interp(x=np.linspace(0, 1, 100)).plot.line(label="linear (default)") │ │ │ │ -Out[18]: [<matplotlib.lines.Line2D at 0xe55b8c10>] │ │ │ │ +Out[18]: [<matplotlib.lines.Line2D at 0xa48afd30>] │ │ │ │ │ │ │ │ In [19]: da.interp(x=np.linspace(0, 1, 100), method="cubic").plot.line(label="cubic") │ │ │ │ -Out[19]: [<matplotlib.lines.Line2D at 0xe865f7f0>] │ │ │ │ +Out[19]: [<matplotlib.lines.Line2D at 0xa48afe38>] │ │ │ │ │ │ │ │ In [20]: plt.legend() │ │ │ │ -Out[20]: <matplotlib.legend.Legend at 0xe3442ca0> │ │ │ │ +Out[20]: <matplotlib.legend.Legend at 0xa26bae50> │ │ │ │ │ │ │ │ │ │ │ │ _images/interpolation_sample1.png │ │ │ │

    Additional keyword arguments can be passed to scipy’s functions.

    │ │ │ │
    # fill 0 for the outside of the original coordinates.
    │ │ │ │  In [21]: da.interp(x=np.linspace(-0.5, 1.5, 10), kwargs={"fill_value": 0.0})
    │ │ │ │  Out[21]: 
    │ │ │ │ @@ -611,15 +611,15 @@
    │ │ │ │  /build/reproducible-path/python-xarray-0.16.2/xarray/tutorial.py in open_dataset(name, cache, cache_dir, github_url, branch, **kws)
    │ │ │ │       76         # May want to add an option to remove it.
    │ │ │ │       77         if not _os.path.isdir(longdir):
    │ │ │ │  ---> 78             _os.mkdir(longdir)
    │ │ │ │       79 
    │ │ │ │       80         url = "/".join((github_url, "raw", branch, fullname))
    │ │ │ │  
    │ │ │ │ -FileNotFoundError: [Errno 2] No such file or directory: '/nonexistent/first-build/.xarray_tutorial_data'
    │ │ │ │ +FileNotFoundError: [Errno 2] No such file or directory: '/nonexistent/second-build/.xarray_tutorial_data'
    │ │ │ │  
    │ │ │ │  In [45]: fig, axes = plt.subplots(ncols=2, figsize=(10, 4))
    │ │ │ │  
    │ │ │ │  In [46]: ds.air.plot(ax=axes[0])
    │ │ │ │  ---------------------------------------------------------------------------
    │ │ │ │  AttributeError                            Traceback (most recent call last)
    │ │ │ │  <ipython-input-46-cb8f083667be> in <module>
    │ │ │ │ ├── html2text {}
    │ │ │ │ │ @@ -202,26 +202,26 @@
    │ │ │ │ │     ....:     np.sin(np.linspace(0, 2 * np.pi, 10)),
    │ │ │ │ │     ....:     dims="x",
    │ │ │ │ │     ....:     coords={"x": np.linspace(0, 1, 10)},
    │ │ │ │ │     ....: )
    │ │ │ │ │     ....:
    │ │ │ │ │  
    │ │ │ │ │  In [17]: da.plot.line("o", label="original")
    │ │ │ │ │ -Out[17]: []
    │ │ │ │ │ +Out[17]: []
    │ │ │ │ │  
    │ │ │ │ │  In [18]: da.interp(x=np.linspace(0, 1, 100)).plot.line(label="linear
    │ │ │ │ │  (default)")
    │ │ │ │ │ -Out[18]: []
    │ │ │ │ │ +Out[18]: []
    │ │ │ │ │  
    │ │ │ │ │  In [19]: da.interp(x=np.linspace(0, 1, 100), method="cubic").plot.line
    │ │ │ │ │  (label="cubic")
    │ │ │ │ │ -Out[19]: []
    │ │ │ │ │ +Out[19]: []
    │ │ │ │ │  
    │ │ │ │ │  In [20]: plt.legend()
    │ │ │ │ │ -Out[20]: 
    │ │ │ │ │ +Out[20]: 
    │ │ │ │ │  [_images/interpolation_sample1.png]
    │ │ │ │ │  Additional keyword arguments can be passed to scipy’s functions.
    │ │ │ │ │  # fill 0 for the outside of the original coordinates.
    │ │ │ │ │  In [21]: da.interp(x=np.linspace(-0.5, 1.5, 10), kwargs={"fill_value": 0.0})
    │ │ │ │ │  Out[21]:
    │ │ │ │ │  
    │ │ │ │ │  array([ 0.   ,  0.   ,  0.   ,  0.814,  0.604, -0.604, -0.814,  0.   ,  0.   ,
    │ │ │ │ │ @@ -390,15 +390,15 @@
    │ │ │ │ │  open_dataset(name, cache, cache_dir, github_url, branch, **kws)
    │ │ │ │ │       76         # May want to add an option to remove it.
    │ │ │ │ │       77         if not _os.path.isdir(longdir):
    │ │ │ │ │  ---> 78             _os.mkdir(longdir)
    │ │ │ │ │       79
    │ │ │ │ │       80         url = "/".join((github_url, "raw", branch, fullname))
    │ │ │ │ │  
    │ │ │ │ │ -FileNotFoundError: [Errno 2] No such file or directory: '/nonexistent/first-
    │ │ │ │ │ +FileNotFoundError: [Errno 2] No such file or directory: '/nonexistent/second-
    │ │ │ │ │  build/.xarray_tutorial_data'
    │ │ │ │ │  
    │ │ │ │ │  In [45]: fig, axes = plt.subplots(ncols=2, figsize=(10, 4))
    │ │ │ │ │  
    │ │ │ │ │  In [46]: ds.air.plot(ax=axes[0])
    │ │ │ │ │  ---------------------------------------------------------------------------
    │ │ │ │ │  AttributeError                            Traceback (most recent call last)
    │ │ │ ├── ./usr/share/doc/python-xarray-doc/html/io.html
    │ │ │ │ @@ -1059,15 +1059,15 @@
    │ │ │ │     ....:         "y": pd.date_range("2000-01-01", periods=5),
    │ │ │ │     ....:         "z": ("x", list("abcd")),
    │ │ │ │     ....:     },
    │ │ │ │     ....: )
    │ │ │ │     ....: 
    │ │ │ │  
    │ │ │ │  In [39]: ds.to_zarr("path/to/directory.zarr")
    │ │ │ │ -Out[39]: <xarray.backends.zarr.ZarrStore at 0xe2c9ebf8>
    │ │ │ │ +Out[39]: <xarray.backends.zarr.ZarrStore at 0xa1f0f9e8>
    │ │ │ │  
    │ │ │ │
    │ │ │ │

    (The suffix .zarr is optional–just a reminder that a zarr store lives │ │ │ │ there.) If the directory does not exist, it will be created. If a zarr │ │ │ │ store is already present at that path, an error will be raised, preventing it │ │ │ │ from being overwritten. To override this behavior and overwrite an existing │ │ │ │ store, add mode='w' when invoking to_zarr().

    │ │ │ │ @@ -1113,15 +1113,15 @@ │ │ │ │ These options can be passed to the to_zarr method as variable encoding. │ │ │ │ For example:

    │ │ │ │
    In [42]: import zarr
    │ │ │ │  
    │ │ │ │  In [43]: compressor = zarr.Blosc(cname="zstd", clevel=3, shuffle=2)
    │ │ │ │  
    │ │ │ │  In [44]: ds.to_zarr("foo.zarr", encoding={"foo": {"compressor": compressor}})
    │ │ │ │ -Out[44]: <xarray.backends.zarr.ZarrStore at 0xe2cb7418>
    │ │ │ │ +Out[44]: <xarray.backends.zarr.ZarrStore at 0xa1f21298>
    │ │ │ │  
    │ │ │ │
    │ │ │ │
    │ │ │ │

    Note

    │ │ │ │

    Not all native zarr compression and filtering options have been tested with │ │ │ │ xarray.

    │ │ │ │
    │ │ │ │ @@ -1182,28 +1182,28 @@ │ │ │ │ ....: "y": [1, 2, 3, 4, 5], │ │ │ │ ....: "t": pd.date_range("2001-01-01", periods=2), │ │ │ │ ....: }, │ │ │ │ ....: ) │ │ │ │ ....: │ │ │ │ │ │ │ │ In [46]: ds1.to_zarr("path/to/directory.zarr") │ │ │ │ -Out[46]: <xarray.backends.zarr.ZarrStore at 0xe2cb7538> │ │ │ │ +Out[46]: <xarray.backends.zarr.ZarrStore at 0xa1f214d8> │ │ │ │ │ │ │ │ In [47]: ds2 = xr.Dataset( │ │ │ │ ....: {"foo": (("x", "y", "t"), np.random.rand(4, 5, 2))}, │ │ │ │ ....: coords={ │ │ │ │ ....: "x": [10, 20, 30, 40], │ │ │ │ ....: "y": [1, 2, 3, 4, 5], │ │ │ │ ....: "t": pd.date_range("2001-01-03", periods=2), │ │ │ │ ....: }, │ │ │ │ ....: ) │ │ │ │ ....: │ │ │ │ │ │ │ │ In [48]: ds2.to_zarr("path/to/directory.zarr", append_dim="t") │ │ │ │ -Out[48]: <xarray.backends.zarr.ZarrStore at 0xe2cb7a78> │ │ │ │ +Out[48]: <xarray.backends.zarr.ZarrStore at 0xa1f21958> │ │ │ │ │ │ │ │ │ │ │ │

    Finally, you can use region to write to limited regions of existing arrays │ │ │ │ in an existing Zarr store. This is a good option for writing data in parallel │ │ │ │ from independent processes.

    │ │ │ │

    To scale this up to writing large datasets, the first step is creating an │ │ │ │ initial Zarr store without writing all of its array data. This can be done by │ │ │ │ @@ -1218,33 +1218,33 @@ │ │ │ │ │ │ │ │ In [51]: ds = xr.Dataset({"foo": ("x", dummies)}) │ │ │ │ │ │ │ │ In [52]: path = "path/to/directory.zarr" │ │ │ │ │ │ │ │ # Now we write the metadata without computing any array values │ │ │ │ In [53]: ds.to_zarr(path, compute=False, consolidated=True) │ │ │ │ -Out[53]: Delayed('_finalize_store-1a13d624-cacf-4160-83a2-84bc57f54340') │ │ │ │ +Out[53]: Delayed('_finalize_store-84826c16-f21f-4c17-b8bf-0c71a9942837') │ │ │ │ │ │ │ │ │ │ │ │

    Now, a Zarr store with the correct variable shapes and attributes exists that │ │ │ │ can be filled out by subsequent calls to to_zarr. The region provides a │ │ │ │ mapping from dimension names to Python slice objects indicating where the │ │ │ │ data should be written (in index space, not coordinate space), e.g.,

    │ │ │ │
    # For convenience, we'll slice a single dataset, but in the real use-case
    │ │ │ │  # we would create them separately, possibly even from separate processes.
    │ │ │ │  In [54]: ds = xr.Dataset({"foo": ("x", np.arange(30))})
    │ │ │ │  
    │ │ │ │  In [55]: ds.isel(x=slice(0, 10)).to_zarr(path, region={"x": slice(0, 10)})
    │ │ │ │ -Out[55]: <xarray.backends.zarr.ZarrStore at 0xe2cb7928>
    │ │ │ │ +Out[55]: <xarray.backends.zarr.ZarrStore at 0xa1f219e8>
    │ │ │ │  
    │ │ │ │  In [56]: ds.isel(x=slice(10, 20)).to_zarr(path, region={"x": slice(10, 20)})
    │ │ │ │ -Out[56]: <xarray.backends.zarr.ZarrStore at 0xe8774418>
    │ │ │ │ +Out[56]: <xarray.backends.zarr.ZarrStore at 0xa49351a8>
    │ │ │ │  
    │ │ │ │  In [57]: ds.isel(x=slice(20, 30)).to_zarr(path, region={"x": slice(20, 30)})
    │ │ │ │ -Out[57]: <xarray.backends.zarr.ZarrStore at 0xe7fc4c88>
    │ │ │ │ +Out[57]: <xarray.backends.zarr.ZarrStore at 0xa5133c88>
    │ │ │ │  
    │ │ │ │
    │ │ │ │

    Concurrent writes with region are safe as long as they modify distinct │ │ │ │ chunks in the underlying Zarr arrays (or use an appropriate lock).

    │ │ │ │

    As a safety check to make it harder to inadvertently override existing values, │ │ │ │ if you set region then all variables included in a Dataset must have │ │ │ │ dimensions included in region. Other variables (typically coordinates) │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -762,15 +762,15 @@ │ │ │ │ │ ....: "y": pd.date_range("2000-01-01", periods=5), │ │ │ │ │ ....: "z": ("x", list("abcd")), │ │ │ │ │ ....: }, │ │ │ │ │ ....: ) │ │ │ │ │ ....: │ │ │ │ │ │ │ │ │ │ In [39]: ds.to_zarr("path/to/directory.zarr") │ │ │ │ │ -Out[39]: │ │ │ │ │ +Out[39]: │ │ │ │ │ (The suffix .zarr is optional–just a reminder that a zarr store lives there.) │ │ │ │ │ If the directory does not exist, it will be created. If a zarr store is already │ │ │ │ │ present at that path, an error will be raised, preventing it from being │ │ │ │ │ overwritten. To override this behavior and overwrite an existing store, add │ │ │ │ │ mode='w' when invoking to_zarr(). │ │ │ │ │ To store variable length strings, convert them to object arrays first with │ │ │ │ │ dtype=object. │ │ │ │ │ @@ -806,15 +806,15 @@ │ │ │ │ │ zarr. These are described in the zarr_documentation. These options can be │ │ │ │ │ passed to the to_zarr method as variable encoding. For example: │ │ │ │ │ In [42]: import zarr │ │ │ │ │ │ │ │ │ │ In [43]: compressor = zarr.Blosc(cname="zstd", clevel=3, shuffle=2) │ │ │ │ │ │ │ │ │ │ In [44]: ds.to_zarr("foo.zarr", encoding={"foo": {"compressor": compressor}}) │ │ │ │ │ -Out[44]: │ │ │ │ │ +Out[44]: │ │ │ │ │ Note │ │ │ │ │ Not all native zarr compression and filtering options have been tested with │ │ │ │ │ xarray. │ │ │ │ │ **** Consolidated Metadata¶ **** │ │ │ │ │ Xarray needs to read all of the zarr metadata when it opens a dataset. In some │ │ │ │ │ storage mediums, such as with cloud object storage (e.g. amazon S3), this can │ │ │ │ │ introduce significant overhead, because two separate HTTP calls to the object │ │ │ │ │ @@ -854,28 +854,28 @@ │ │ │ │ │ ....: "y": [1, 2, 3, 4, 5], │ │ │ │ │ ....: "t": pd.date_range("2001-01-01", periods=2), │ │ │ │ │ ....: }, │ │ │ │ │ ....: ) │ │ │ │ │ ....: │ │ │ │ │ │ │ │ │ │ In [46]: ds1.to_zarr("path/to/directory.zarr") │ │ │ │ │ -Out[46]: │ │ │ │ │ +Out[46]: │ │ │ │ │ │ │ │ │ │ In [47]: ds2 = xr.Dataset( │ │ │ │ │ ....: {"foo": (("x", "y", "t"), np.random.rand(4, 5, 2))}, │ │ │ │ │ ....: coords={ │ │ │ │ │ ....: "x": [10, 20, 30, 40], │ │ │ │ │ ....: "y": [1, 2, 3, 4, 5], │ │ │ │ │ ....: "t": pd.date_range("2001-01-03", periods=2), │ │ │ │ │ ....: }, │ │ │ │ │ ....: ) │ │ │ │ │ ....: │ │ │ │ │ │ │ │ │ │ In [48]: ds2.to_zarr("path/to/directory.zarr", append_dim="t") │ │ │ │ │ -Out[48]: │ │ │ │ │ +Out[48]: │ │ │ │ │ Finally, you can use region to write to limited regions of existing arrays in │ │ │ │ │ an existing Zarr store. This is a good option for writing data in parallel from │ │ │ │ │ independent processes. │ │ │ │ │ To scale this up to writing large datasets, the first step is creating an │ │ │ │ │ initial Zarr store without writing all of its array data. This can be done by │ │ │ │ │ first creating a Dataset with dummy values stored in dask, and then calling │ │ │ │ │ to_zarr with compute=False to write only metadata (including attrs) to Zarr: │ │ │ │ │ @@ -887,31 +887,31 @@ │ │ │ │ │ │ │ │ │ │ In [51]: ds = xr.Dataset({"foo": ("x", dummies)}) │ │ │ │ │ │ │ │ │ │ In [52]: path = "path/to/directory.zarr" │ │ │ │ │ │ │ │ │ │ # Now we write the metadata without computing any array values │ │ │ │ │ In [53]: ds.to_zarr(path, compute=False, consolidated=True) │ │ │ │ │ -Out[53]: Delayed('_finalize_store-1a13d624-cacf-4160-83a2-84bc57f54340') │ │ │ │ │ +Out[53]: Delayed('_finalize_store-84826c16-f21f-4c17-b8bf-0c71a9942837') │ │ │ │ │ Now, a Zarr store with the correct variable shapes and attributes exists that │ │ │ │ │ can be filled out by subsequent calls to to_zarr. The region provides a mapping │ │ │ │ │ from dimension names to Python slice objects indicating where the data should │ │ │ │ │ be written (in index space, not coordinate space), e.g., │ │ │ │ │ # For convenience, we'll slice a single dataset, but in the real use-case │ │ │ │ │ # we would create them separately, possibly even from separate processes. │ │ │ │ │ In [54]: ds = xr.Dataset({"foo": ("x", np.arange(30))}) │ │ │ │ │ │ │ │ │ │ In [55]: ds.isel(x=slice(0, 10)).to_zarr(path, region={"x": slice(0, 10)}) │ │ │ │ │ -Out[55]: │ │ │ │ │ +Out[55]: │ │ │ │ │ │ │ │ │ │ In [56]: ds.isel(x=slice(10, 20)).to_zarr(path, region={"x": slice(10, 20)}) │ │ │ │ │ -Out[56]: │ │ │ │ │ +Out[56]: │ │ │ │ │ │ │ │ │ │ In [57]: ds.isel(x=slice(20, 30)).to_zarr(path, region={"x": slice(20, 30)}) │ │ │ │ │ -Out[57]: │ │ │ │ │ +Out[57]: │ │ │ │ │ Concurrent writes with region are safe as long as they modify distinct chunks │ │ │ │ │ in the underlying Zarr arrays (or use an appropriate lock). │ │ │ │ │ As a safety check to make it harder to inadvertently override existing values, │ │ │ │ │ if you set region then all variables included in a Dataset must have dimensions │ │ │ │ │ included in region. Other variables (typically coordinates) need to be │ │ │ │ │ explicitly dropped and/or written in a separate calls to to_zarr with mode='a'. │ │ │ │ │ ***** GRIB format via cfgrib¶ ***** │ │ │ ├── ./usr/share/doc/python-xarray-doc/html/plotting.html │ │ │ │ @@ -326,15 +326,15 @@ │ │ │ │ /build/reproducible-path/python-xarray-0.16.2/xarray/tutorial.py in open_dataset(name, cache, cache_dir, github_url, branch, **kws) │ │ │ │ 76 # May want to add an option to remove it. │ │ │ │ 77 if not _os.path.isdir(longdir): │ │ │ │ ---> 78 _os.mkdir(longdir) │ │ │ │ 79 │ │ │ │ 80 url = "/".join((github_url, "raw", branch, fullname)) │ │ │ │ │ │ │ │ -FileNotFoundError: [Errno 2] No such file or directory: '/nonexistent/first-build/.xarray_tutorial_data' │ │ │ │ +FileNotFoundError: [Errno 2] No such file or directory: '/nonexistent/second-build/.xarray_tutorial_data' │ │ │ │ │ │ │ │ In [6]: airtemps │ │ │ │ --------------------------------------------------------------------------- │ │ │ │ NameError Traceback (most recent call last) │ │ │ │ <ipython-input-6-eb57b540ddce> in <module> │ │ │ │ ----> 1 airtemps │ │ │ │ │ │ │ │ @@ -852,15 +852,15 @@ │ │ │ │ --> 171 ref_var = variables[ref_name] │ │ │ │ 172 │ │ │ │ 173 if var_name is None: │ │ │ │ │ │ │ │ KeyError: 'lat' │ │ │ │ │ │ │ │ In [51]: b.plot() │ │ │ │ -Out[51]: [<matplotlib.lines.Line2D at 0xe29532b0>] │ │ │ │ +Out[51]: [<matplotlib.lines.Line2D at 0xa1bc43e8>] │ │ │ │ │ │ │ │ │ │ │ │ _images/plotting_nonuniform_coords.png │ │ │ │ │ │ │ │

    │ │ │ │

    Calling Matplotlib

    │ │ │ │

    Since this is a thin wrapper around matplotlib, all the functionality of │ │ │ │ @@ -1314,56 +1314,56 @@ │ │ │ │ Data variables: │ │ │ │ A (x, y, z, w) float64 -0.104 0.02719 -0.0425 ... -0.1175 -0.0183 │ │ │ │ B (x, y, z, w) float64 0.0 0.0 0.0 0.0 ... 1.369 1.408 1.387 1.417 │ │ │ │

    │ │ │ │ │ │ │ │

    Suppose we want to scatter A against B

    │ │ │ │
    In [95]: ds.plot.scatter(x="A", y="B")
    │ │ │ │ -Out[95]: <matplotlib.collections.PathCollection at 0xe2c48160>
    │ │ │ │ +Out[95]: <matplotlib.collections.PathCollection at 0xa1ec6be0>
    │ │ │ │  
    │ │ │ │
    │ │ │ │ _images/ds_simple_scatter.png │ │ │ │

    The hue kwarg lets you vary the color by variable value

    │ │ │ │
    In [96]: ds.plot.scatter(x="A", y="B", hue="w")
    │ │ │ │  Out[96]: 
    │ │ │ │ -[<matplotlib.collections.PathCollection at 0xe55b30b8>,
    │ │ │ │ - <matplotlib.collections.PathCollection at 0xe5763d60>,
    │ │ │ │ - <matplotlib.collections.PathCollection at 0xe5863070>,
    │ │ │ │ - <matplotlib.collections.PathCollection at 0xe557a568>]
    │ │ │ │ +[<matplotlib.collections.PathCollection at 0xa26baca0>,
    │ │ │ │ + <matplotlib.collections.PathCollection at 0xa4829430>,
    │ │ │ │ + <matplotlib.collections.PathCollection at 0xa497e7c0>,
    │ │ │ │ + <matplotlib.collections.PathCollection at 0xa51066e8>]
    │ │ │ │  
    │ │ │ │
    │ │ │ │ _images/ds_hue_scatter.png │ │ │ │

    When hue is specified, a colorbar is added for numeric hue DataArrays by │ │ │ │ default and a legend is added for non-numeric hue DataArrays (as above). │ │ │ │ You can force a legend instead of a colorbar by setting hue_style='discrete'. │ │ │ │ Additionally, the boolean kwarg add_guide can be used to prevent the display of a legend or colorbar (as appropriate).

    │ │ │ │
    In [97]: ds = ds.assign(w=[1, 2, 3, 5])
    │ │ │ │  
    │ │ │ │  In [98]: ds.plot.scatter(x="A", y="B", hue="w", hue_style="discrete")
    │ │ │ │  Out[98]: 
    │ │ │ │ -[<matplotlib.collections.PathCollection at 0xe2915610>,
    │ │ │ │ - <matplotlib.collections.PathCollection at 0xe291de50>,
    │ │ │ │ - <matplotlib.collections.PathCollection at 0xe27abad8>,
    │ │ │ │ - <matplotlib.collections.PathCollection at 0xe291dec8>]
    │ │ │ │ +[<matplotlib.collections.PathCollection at 0xa1b85ca0>,
    │ │ │ │ + <matplotlib.collections.PathCollection at 0xa1b8cf70>,
    │ │ │ │ + <matplotlib.collections.PathCollection at 0xa1a1dbb0>,
    │ │ │ │ + <matplotlib.collections.PathCollection at 0xa1a20b98>]
    │ │ │ │  
    │ │ │ │
    │ │ │ │ _images/ds_discrete_legend_hue_scatter.png │ │ │ │

    The markersize kwarg lets you vary the point’s size by variable value. You can additionally pass size_norm to control how the variable’s values are mapped to point sizes.

    │ │ │ │
    In [99]: ds.plot.scatter(x="A", y="B", hue="z", hue_style="discrete", markersize="z")
    │ │ │ │  Out[99]: 
    │ │ │ │ -[<matplotlib.collections.PathCollection at 0xe2751e98>,
    │ │ │ │ - <matplotlib.collections.PathCollection at 0xe27abf58>,
    │ │ │ │ - <matplotlib.collections.PathCollection at 0xe27b6cd0>,
    │ │ │ │ - <matplotlib.collections.PathCollection at 0xe27b13e8>]
    │ │ │ │ +[<matplotlib.collections.PathCollection at 0xa1a2e190>,
    │ │ │ │ + <matplotlib.collections.PathCollection at 0xa1a20d78>,
    │ │ │ │ + <matplotlib.collections.PathCollection at 0xa1a20f88>,
    │ │ │ │ + <matplotlib.collections.PathCollection at 0xa1a23508>]
    │ │ │ │  
    │ │ │ │
    │ │ │ │ _images/ds_hue_size_scatter.png │ │ │ │

    Faceting is also possible

    │ │ │ │
    In [100]: ds.plot.scatter(x="A", y="B", col="x", row="z", hue="w", hue_style="discrete")
    │ │ │ │ -Out[100]: <xarray.plot.facetgrid.FacetGrid at 0xe7fb1250>
    │ │ │ │ +Out[100]: <xarray.plot.facetgrid.FacetGrid at 0xa1b85a00>
    │ │ │ │  
    │ │ │ │
    │ │ │ │ _images/ds_facet_scatter.png │ │ │ │

    For more advanced scatter plots, we recommend converting the relevant data variables to a pandas DataFrame and using the extensive plotting capabilities of seaborn.

    │ │ │ │ │ │ │ │
    │ │ │ │

    Maps

    │ │ │ │ @@ -1380,15 +1380,15 @@ │ │ │ │ /build/reproducible-path/python-xarray-0.16.2/xarray/tutorial.py in open_dataset(name, cache, cache_dir, github_url, branch, **kws) │ │ │ │ 76 # May want to add an option to remove it. │ │ │ │ 77 if not _os.path.isdir(longdir): │ │ │ │ ---> 78 _os.mkdir(longdir) │ │ │ │ 79 │ │ │ │ 80 url = "/".join((github_url, "raw", branch, fullname)) │ │ │ │ │ │ │ │ -FileNotFoundError: [Errno 2] No such file or directory: '/nonexistent/first-build/.xarray_tutorial_data' │ │ │ │ +FileNotFoundError: [Errno 2] No such file or directory: '/nonexistent/second-build/.xarray_tutorial_data' │ │ │ │ │ │ │ │ In [103]: p = air.isel(time=0).plot( │ │ │ │ .....: subplot_kws=dict(projection=ccrs.Orthographic(-80, 35), facecolor="gray"), │ │ │ │ .....: transform=ccrs.PlateCarree(), │ │ │ │ .....: ) │ │ │ │ .....: │ │ │ │ --------------------------------------------------------------------------- │ │ │ │ @@ -1472,24 +1472,24 @@ │ │ │ │
    In [109]: import xarray.plot as xplt
    │ │ │ │  
    │ │ │ │  In [110]: da = xr.DataArray(range(5))
    │ │ │ │  
    │ │ │ │  In [111]: fig, axes = plt.subplots(ncols=2, nrows=2)
    │ │ │ │  
    │ │ │ │  In [112]: da.plot(ax=axes[0, 0])
    │ │ │ │ -Out[112]: [<matplotlib.lines.Line2D at 0xe1ee2c88>]
    │ │ │ │ +Out[112]: [<matplotlib.lines.Line2D at 0xa11bfd78>]
    │ │ │ │  
    │ │ │ │  In [113]: da.plot.line(ax=axes[0, 1])
    │ │ │ │ -Out[113]: [<matplotlib.lines.Line2D at 0xe1f05c40>]
    │ │ │ │ +Out[113]: [<matplotlib.lines.Line2D at 0xb305b9a0>]
    │ │ │ │  
    │ │ │ │  In [114]: xplt.plot(da, ax=axes[1, 0])
    │ │ │ │ -Out[114]: [<matplotlib.lines.Line2D at 0xe1f2b7a8>]
    │ │ │ │ +Out[114]: [<matplotlib.lines.Line2D at 0xb3024688>]
    │ │ │ │  
    │ │ │ │  In [115]: xplt.line(da, ax=axes[1, 1])
    │ │ │ │ -Out[115]: [<matplotlib.lines.Line2D at 0xe1f2a700>]
    │ │ │ │ +Out[115]: [<matplotlib.lines.Line2D at 0xb3075f88>]
    │ │ │ │  
    │ │ │ │  In [116]: plt.tight_layout()
    │ │ │ │  
    │ │ │ │  In [117]: plt.draw()
    │ │ │ │  
    │ │ │ │
    │ │ │ │ _images/plotting_ways_to_use.png │ │ │ │ @@ -1542,15 +1542,15 @@ │ │ │ │
    │ │ │ │

    The plot will produce an image corresponding to the values of the array. │ │ │ │ Hence the top left pixel will be a different color than the others. │ │ │ │ Before reading on, you may want to look at the coordinates and │ │ │ │ think carefully about what the limits, labels, and orientation for │ │ │ │ each of the axes should be.

    │ │ │ │
    In [122]: a.plot()
    │ │ │ │ -Out[122]: <matplotlib.collections.QuadMesh at 0xe2435b20>
    │ │ │ │ +Out[122]: <matplotlib.collections.QuadMesh at 0xa16abfd0>
    │ │ │ │  
    │ │ │ │
    │ │ │ │ _images/plotting_example_2d_simple.png │ │ │ │

    It may seem strange that │ │ │ │ the values on the y axis are decreasing with -0.5 on the top. This is because │ │ │ │ the pixels are centered over their coordinates, and the │ │ │ │ axis labels and ranges correspond to the values of the │ │ │ │ @@ -1572,81 +1572,81 @@ │ │ │ │ .....: np.arange(20).reshape(4, 5), │ │ │ │ .....: dims=["y", "x"], │ │ │ │ .....: coords={"lat": (("y", "x"), lat), "lon": (("y", "x"), lon)}, │ │ │ │ .....: ) │ │ │ │ .....: │ │ │ │ │ │ │ │ In [127]: da.plot.pcolormesh("lon", "lat") │ │ │ │ -Out[127]: <matplotlib.collections.QuadMesh at 0xe8188748> │ │ │ │ +Out[127]: <matplotlib.collections.QuadMesh at 0xa1f34910> │ │ │ │ │ │ │ │ │ │ │ │ _images/plotting_example_2d_irreg.png │ │ │ │

    Note that in this case, xarray still follows the pixel centered convention. │ │ │ │ This might be undesirable in some cases, for example when your data is defined │ │ │ │ on a polar projection (GH781). This is why the default is to not follow │ │ │ │ this convention when plotting on a map:

    │ │ │ │
    In [128]: import cartopy.crs as ccrs
    │ │ │ │  
    │ │ │ │  In [129]: ax = plt.subplot(projection=ccrs.PlateCarree())
    │ │ │ │  
    │ │ │ │  In [130]: da.plot.pcolormesh("lon", "lat", ax=ax)
    │ │ │ │ -Out[130]: <matplotlib.collections.QuadMesh at 0xe22b31c0>
    │ │ │ │ +Out[130]: <matplotlib.collections.QuadMesh at 0xa152c2b0>
    │ │ │ │  
    │ │ │ │  In [131]: ax.scatter(lon, lat, transform=ccrs.PlateCarree())
    │ │ │ │ -Out[131]: <matplotlib.collections.PathCollection at 0xe2254478>
    │ │ │ │ +Out[131]: <matplotlib.collections.PathCollection at 0xa1548568>
    │ │ │ │  
    │ │ │ │  In [132]: ax.coastlines()
    │ │ │ │ -Out[132]: <cartopy.mpl.feature_artist.FeatureArtist at 0xe2298ce8>
    │ │ │ │ +Out[132]: <cartopy.mpl.feature_artist.FeatureArtist at 0xa0c16dc0>
    │ │ │ │  
    │ │ │ │  In [133]: ax.gridlines(draw_labels=True)
    │ │ │ │ -Out[133]: <cartopy.mpl.gridliner.Gridliner at 0xe2254598>
    │ │ │ │ +Out[133]: <cartopy.mpl.gridliner.Gridliner at 0xa1548688>
    │ │ │ │  
    │ │ │ │
    │ │ │ │ _build/html/_static/plotting_example_2d_irreg_map.png │ │ │ │

    You can however decide to infer the cell boundaries and use the │ │ │ │ infer_intervals keyword:

    │ │ │ │
    In [134]: ax = plt.subplot(projection=ccrs.PlateCarree())
    │ │ │ │  
    │ │ │ │  In [135]: da.plot.pcolormesh("lon", "lat", ax=ax, infer_intervals=True)
    │ │ │ │ -Out[135]: <matplotlib.collections.QuadMesh at 0xe22bef10>
    │ │ │ │ +Out[135]: <matplotlib.collections.QuadMesh at 0xa1534a00>
    │ │ │ │  
    │ │ │ │  In [136]: ax.scatter(lon, lat, transform=ccrs.PlateCarree())
    │ │ │ │ -Out[136]: <matplotlib.collections.PathCollection at 0xe2148328>
    │ │ │ │ +Out[136]: <matplotlib.collections.PathCollection at 0xa13bf418>
    │ │ │ │  
    │ │ │ │  In [137]: ax.coastlines()
    │ │ │ │ -Out[137]: <cartopy.mpl.feature_artist.FeatureArtist at 0xe2261838>
    │ │ │ │ +Out[137]: <cartopy.mpl.feature_artist.FeatureArtist at 0xa14d7970>
    │ │ │ │  
    │ │ │ │  In [138]: ax.gridlines(draw_labels=True)
    │ │ │ │ -Out[138]: <cartopy.mpl.gridliner.Gridliner at 0xe22bebc8>
    │ │ │ │ +Out[138]: <cartopy.mpl.gridliner.Gridliner at 0xa1534cb8>
    │ │ │ │  
    │ │ │ │
    │ │ │ │ _build/html/_static/plotting_example_2d_irreg_map_infer.png │ │ │ │
    │ │ │ │

    Note

    │ │ │ │

    The data model of xarray does not support datasets with cell boundaries │ │ │ │ yet. If you want to use these coordinates, you’ll have to make the plots │ │ │ │ outside the xarray framework.

    │ │ │ │
    │ │ │ │

    One can also make line plots with multidimensional coordinates. In this case, hue must be a dimension name, not a coordinate name.

    │ │ │ │
    In [139]: f, ax = plt.subplots(2, 1)
    │ │ │ │  
    │ │ │ │  In [140]: da.plot.line(x="lon", hue="y", ax=ax[0])
    │ │ │ │  Out[140]: 
    │ │ │ │ -[<matplotlib.lines.Line2D at 0xe22615c8>,
    │ │ │ │ - <matplotlib.lines.Line2D at 0xe22618f8>,
    │ │ │ │ - <matplotlib.lines.Line2D at 0xe22cecb8>,
    │ │ │ │ - <matplotlib.lines.Line2D at 0xe2148d00>]
    │ │ │ │ +[<matplotlib.lines.Line2D at 0xa14d7a18>,
    │ │ │ │ + <matplotlib.lines.Line2D at 0xa14d7a30>,
    │ │ │ │ + <matplotlib.lines.Line2D at 0xa1542a30>,
    │ │ │ │ + <matplotlib.lines.Line2D at 0xa0c16ec8>]
    │ │ │ │  
    │ │ │ │  In [141]: da.plot.line(x="lon", hue="x", ax=ax[1])
    │ │ │ │  Out[141]: 
    │ │ │ │ -[<matplotlib.lines.Line2D at 0xe209f928>,
    │ │ │ │ - <matplotlib.lines.Line2D at 0xe209f958>,
    │ │ │ │ - <matplotlib.lines.Line2D at 0xe209f988>,
    │ │ │ │ - <matplotlib.lines.Line2D at 0xe209f9e8>,
    │ │ │ │ - <matplotlib.lines.Line2D at 0xe209fa48>]
    │ │ │ │ +[<matplotlib.lines.Line2D at 0xa1319a18>,
    │ │ │ │ + <matplotlib.lines.Line2D at 0xa1319a48>,
    │ │ │ │ + <matplotlib.lines.Line2D at 0xa1319a78>,
    │ │ │ │ + <matplotlib.lines.Line2D at 0xa1319ad8>,
    │ │ │ │ + <matplotlib.lines.Line2D at 0xa1319b38>]
    │ │ │ │  
    │ │ │ │
    │ │ │ │ _images/plotting_example_2d_hue_xy.png │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -121,15 +121,15 @@ │ │ │ │ │ open_dataset(name, cache, cache_dir, github_url, branch, **kws) │ │ │ │ │ 76 # May want to add an option to remove it. │ │ │ │ │ 77 if not _os.path.isdir(longdir): │ │ │ │ │ ---> 78 _os.mkdir(longdir) │ │ │ │ │ 79 │ │ │ │ │ 80 url = "/".join((github_url, "raw", branch, fullname)) │ │ │ │ │ │ │ │ │ │ -FileNotFoundError: [Errno 2] No such file or directory: '/nonexistent/first- │ │ │ │ │ +FileNotFoundError: [Errno 2] No such file or directory: '/nonexistent/second- │ │ │ │ │ build/.xarray_tutorial_data' │ │ │ │ │ │ │ │ │ │ In [6]: airtemps │ │ │ │ │ --------------------------------------------------------------------------- │ │ │ │ │ NameError Traceback (most recent call last) │ │ │ │ │ in │ │ │ │ │ ----> 1 airtemps │ │ │ │ │ @@ -588,15 +588,15 @@ │ │ │ │ │ --> 171 ref_var = variables[ref_name] │ │ │ │ │ 172 │ │ │ │ │ 173 if var_name is None: │ │ │ │ │ │ │ │ │ │ KeyError: 'lat' │ │ │ │ │ │ │ │ │ │ In [51]: b.plot() │ │ │ │ │ -Out[51]: [] │ │ │ │ │ +Out[51]: [] │ │ │ │ │ [_images/plotting_nonuniform_coords.png] │ │ │ │ │ *** Calling Matplotlib¶ *** │ │ │ │ │ Since this is a thin wrapper around matplotlib, all the functionality of │ │ │ │ │ matplotlib is available. │ │ │ │ │ In [52]: air2d.plot(cmap=plt.cm.Blues) │ │ │ │ │ --------------------------------------------------------------------------- │ │ │ │ │ NameError Traceback (most recent call last) │ │ │ │ │ @@ -984,53 +984,53 @@ │ │ │ │ │ * z (z) int32 0 1 2 3 │ │ │ │ │ * w (w) │ │ │ │ │ +Out[95]: │ │ │ │ │ [_images/ds_simple_scatter.png] │ │ │ │ │ The hue kwarg lets you vary the color by variable value │ │ │ │ │ In [96]: ds.plot.scatter(x="A", y="B", hue="w") │ │ │ │ │ Out[96]: │ │ │ │ │ -[, │ │ │ │ │ - , │ │ │ │ │ - , │ │ │ │ │ - ] │ │ │ │ │ +[, │ │ │ │ │ + , │ │ │ │ │ + , │ │ │ │ │ + ] │ │ │ │ │ [_images/ds_hue_scatter.png] │ │ │ │ │ When hue is specified, a colorbar is added for numeric hue DataArrays by │ │ │ │ │ default and a legend is added for non-numeric hue DataArrays (as above). You │ │ │ │ │ can force a legend instead of a colorbar by setting hue_style='discrete'. │ │ │ │ │ Additionally, the boolean kwarg add_guide can be used to prevent the display of │ │ │ │ │ a legend or colorbar (as appropriate). │ │ │ │ │ In [97]: ds = ds.assign(w=[1, 2, 3, 5]) │ │ │ │ │ │ │ │ │ │ In [98]: ds.plot.scatter(x="A", y="B", hue="w", hue_style="discrete") │ │ │ │ │ Out[98]: │ │ │ │ │ -[, │ │ │ │ │ - , │ │ │ │ │ - , │ │ │ │ │ - ] │ │ │ │ │ +[, │ │ │ │ │ + , │ │ │ │ │ + , │ │ │ │ │ + ] │ │ │ │ │ [_images/ds_discrete_legend_hue_scatter.png] │ │ │ │ │ The markersize kwarg lets you vary the point’s size by variable value. You │ │ │ │ │ can additionally pass size_norm to control how the variable’s values are │ │ │ │ │ mapped to point sizes. │ │ │ │ │ In [99]: ds.plot.scatter(x="A", y="B", hue="z", hue_style="discrete", │ │ │ │ │ markersize="z") │ │ │ │ │ Out[99]: │ │ │ │ │ -[, │ │ │ │ │ - , │ │ │ │ │ - , │ │ │ │ │ - ] │ │ │ │ │ +[, │ │ │ │ │ + , │ │ │ │ │ + , │ │ │ │ │ + ] │ │ │ │ │ [_images/ds_hue_size_scatter.png] │ │ │ │ │ Faceting is also possible │ │ │ │ │ In [100]: ds.plot.scatter(x="A", y="B", col="x", row="z", hue="w", │ │ │ │ │ hue_style="discrete") │ │ │ │ │ -Out[100]: │ │ │ │ │ +Out[100]: │ │ │ │ │ [_images/ds_facet_scatter.png] │ │ │ │ │ For more advanced scatter plots, we recommend converting the relevant data │ │ │ │ │ variables to a pandas DataFrame and using the extensive plotting capabilities │ │ │ │ │ of seaborn. │ │ │ │ │ ***** Maps¶ ***** │ │ │ │ │ To follow this section you’ll need to have Cartopy installed and working. │ │ │ │ │ This script will plot the air temperature on a map. │ │ │ │ │ @@ -1046,15 +1046,15 @@ │ │ │ │ │ open_dataset(name, cache, cache_dir, github_url, branch, **kws) │ │ │ │ │ 76 # May want to add an option to remove it. │ │ │ │ │ 77 if not _os.path.isdir(longdir): │ │ │ │ │ ---> 78 _os.mkdir(longdir) │ │ │ │ │ 79 │ │ │ │ │ 80 url = "/".join((github_url, "raw", branch, fullname)) │ │ │ │ │ │ │ │ │ │ -FileNotFoundError: [Errno 2] No such file or directory: '/nonexistent/first- │ │ │ │ │ +FileNotFoundError: [Errno 2] No such file or directory: '/nonexistent/second- │ │ │ │ │ build/.xarray_tutorial_data' │ │ │ │ │ │ │ │ │ │ In [103]: p = air.isel(time=0).plot( │ │ │ │ │ .....: subplot_kws=dict(projection=ccrs.Orthographic(-80, 35), │ │ │ │ │ facecolor="gray"), │ │ │ │ │ .....: transform=ccrs.PlateCarree(), │ │ │ │ │ .....: ) │ │ │ │ │ @@ -1131,24 +1131,24 @@ │ │ │ │ │ In [109]: import xarray.plot as xplt │ │ │ │ │ │ │ │ │ │ In [110]: da = xr.DataArray(range(5)) │ │ │ │ │ │ │ │ │ │ In [111]: fig, axes = plt.subplots(ncols=2, nrows=2) │ │ │ │ │ │ │ │ │ │ In [112]: da.plot(ax=axes[0, 0]) │ │ │ │ │ -Out[112]: [] │ │ │ │ │ +Out[112]: [] │ │ │ │ │ │ │ │ │ │ In [113]: da.plot.line(ax=axes[0, 1]) │ │ │ │ │ -Out[113]: [] │ │ │ │ │ +Out[113]: [] │ │ │ │ │ │ │ │ │ │ In [114]: xplt.plot(da, ax=axes[1, 0]) │ │ │ │ │ -Out[114]: [] │ │ │ │ │ +Out[114]: [] │ │ │ │ │ │ │ │ │ │ In [115]: xplt.line(da, ax=axes[1, 1]) │ │ │ │ │ -Out[115]: [] │ │ │ │ │ +Out[115]: [] │ │ │ │ │ │ │ │ │ │ In [116]: plt.tight_layout() │ │ │ │ │ │ │ │ │ │ In [117]: plt.draw() │ │ │ │ │ [_images/plotting_ways_to_use.png] │ │ │ │ │ Here the output is the same. Since the data is 1 dimensional the line plot was │ │ │ │ │ used. │ │ │ │ │ @@ -1179,15 +1179,15 @@ │ │ │ │ │ [0., 0., 0.]]) │ │ │ │ │ Dimensions without coordinates: y, x │ │ │ │ │ The plot will produce an image corresponding to the values of the array. Hence │ │ │ │ │ the top left pixel will be a different color than the others. Before reading │ │ │ │ │ on, you may want to look at the coordinates and think carefully about what the │ │ │ │ │ limits, labels, and orientation for each of the axes should be. │ │ │ │ │ In [122]: a.plot() │ │ │ │ │ -Out[122]: │ │ │ │ │ +Out[122]: │ │ │ │ │ [_images/plotting_example_2d_simple.png] │ │ │ │ │ It may seem strange that the values on the y axis are decreasing with -0.5 on │ │ │ │ │ the top. This is because the pixels are centered over their coordinates, and │ │ │ │ │ the axis labels and ranges correspond to the values of the coordinates. │ │ │ │ │ **** Multidimensional coordinates¶ **** │ │ │ │ │ See also: Working_with_Multidimensional_Coordinates. │ │ │ │ │ You can plot irregular grids defined by multidimensional coordinates with │ │ │ │ │ @@ -1204,72 +1204,72 @@ │ │ │ │ │ .....: np.arange(20).reshape(4, 5), │ │ │ │ │ .....: dims=["y", "x"], │ │ │ │ │ .....: coords={"lat": (("y", "x"), lat), "lon": (("y", "x"), lon)}, │ │ │ │ │ .....: ) │ │ │ │ │ .....: │ │ │ │ │ │ │ │ │ │ In [127]: da.plot.pcolormesh("lon", "lat") │ │ │ │ │ -Out[127]: │ │ │ │ │ +Out[127]: │ │ │ │ │ [_images/plotting_example_2d_irreg.png] │ │ │ │ │ Note that in this case, xarray still follows the pixel centered convention. │ │ │ │ │ This might be undesirable in some cases, for example when your data is defined │ │ │ │ │ on a polar projection (GH781). This is why the default is to not follow this │ │ │ │ │ convention when plotting on a map: │ │ │ │ │ In [128]: import cartopy.crs as ccrs │ │ │ │ │ │ │ │ │ │ In [129]: ax = plt.subplot(projection=ccrs.PlateCarree()) │ │ │ │ │ │ │ │ │ │ In [130]: da.plot.pcolormesh("lon", "lat", ax=ax) │ │ │ │ │ -Out[130]: │ │ │ │ │ +Out[130]: │ │ │ │ │ │ │ │ │ │ In [131]: ax.scatter(lon, lat, transform=ccrs.PlateCarree()) │ │ │ │ │ -Out[131]: │ │ │ │ │ +Out[131]: │ │ │ │ │ │ │ │ │ │ In [132]: ax.coastlines() │ │ │ │ │ -Out[132]: │ │ │ │ │ +Out[132]: │ │ │ │ │ │ │ │ │ │ In [133]: ax.gridlines(draw_labels=True) │ │ │ │ │ -Out[133]: │ │ │ │ │ +Out[133]: │ │ │ │ │ [_build/html/_static/plotting_example_2d_irreg_map.png] │ │ │ │ │ You can however decide to infer the cell boundaries and use the infer_intervals │ │ │ │ │ keyword: │ │ │ │ │ In [134]: ax = plt.subplot(projection=ccrs.PlateCarree()) │ │ │ │ │ │ │ │ │ │ In [135]: da.plot.pcolormesh("lon", "lat", ax=ax, infer_intervals=True) │ │ │ │ │ -Out[135]: │ │ │ │ │ +Out[135]: │ │ │ │ │ │ │ │ │ │ In [136]: ax.scatter(lon, lat, transform=ccrs.PlateCarree()) │ │ │ │ │ -Out[136]: │ │ │ │ │ +Out[136]: │ │ │ │ │ │ │ │ │ │ In [137]: ax.coastlines() │ │ │ │ │ -Out[137]: │ │ │ │ │ +Out[137]: │ │ │ │ │ │ │ │ │ │ In [138]: ax.gridlines(draw_labels=True) │ │ │ │ │ -Out[138]: │ │ │ │ │ +Out[138]: │ │ │ │ │ [_build/html/_static/plotting_example_2d_irreg_map_infer.png] │ │ │ │ │ Note │ │ │ │ │ The data model of xarray does not support datasets with cell_boundaries yet. If │ │ │ │ │ you want to use these coordinates, you’ll have to make the plots outside the │ │ │ │ │ xarray framework. │ │ │ │ │ One can also make line plots with multidimensional coordinates. In this case, │ │ │ │ │ hue must be a dimension name, not a coordinate name. │ │ │ │ │ In [139]: f, ax = plt.subplots(2, 1) │ │ │ │ │ │ │ │ │ │ In [140]: da.plot.line(x="lon", hue="y", ax=ax[0]) │ │ │ │ │ Out[140]: │ │ │ │ │ -[, │ │ │ │ │ - , │ │ │ │ │ - , │ │ │ │ │ - ] │ │ │ │ │ +[, │ │ │ │ │ + , │ │ │ │ │ + , │ │ │ │ │ + ] │ │ │ │ │ │ │ │ │ │ In [141]: da.plot.line(x="lon", hue="x", ax=ax[1]) │ │ │ │ │ Out[141]: │ │ │ │ │ -[, │ │ │ │ │ - , │ │ │ │ │ - , │ │ │ │ │ - , │ │ │ │ │ - ] │ │ │ │ │ +[, │ │ │ │ │ + , │ │ │ │ │ + , │ │ │ │ │ + , │ │ │ │ │ + ] │ │ │ │ │ [_images/plotting_example_2d_hue_xy.png] │ │ │ │ │ Next Previous │ │ │ │ │ =============================================================================== │ │ │ │ │ © Copyright 2014-2021, xarray Developers. Last updated on 2021-01-02. │ │ │ │ │ Built with Sphinx using a theme provided by Read_the_Docs. │ │ │ ├── ./usr/share/doc/python-xarray-doc/html/quick-overview.html │ │ │ │ @@ -498,15 +498,15 @@ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │
    │ │ │ │

    Plotting

    │ │ │ │

    Visualizing your datasets is quick and convenient:

    │ │ │ │
    In [37]: data.plot()
    │ │ │ │ -Out[37]: <matplotlib.collections.QuadMesh at 0xe2023d78>
    │ │ │ │ +Out[37]: <matplotlib.collections.QuadMesh at 0xa129be68>
    │ │ │ │  
    │ │ │ │
    │ │ │ │ _images/plotting_quick_overview.png │ │ │ │

    Note the automatic labeling with names and units. Our effort in adding metadata attributes has paid off! Many aspects of these figures are customizable: see Plotting.

    │ │ │ │
    │ │ │ │
    │ │ │ │

    pandas

    │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -304,15 +304,15 @@ │ │ │ │ │ [0.787, 0. , 1.199]]) │ │ │ │ │ Coordinates: │ │ │ │ │ * x (x) int32 10 20 │ │ │ │ │ Dimensions without coordinates: y │ │ │ │ │ ***** Plotting¶ ***** │ │ │ │ │ Visualizing your datasets is quick and convenient: │ │ │ │ │ In [37]: data.plot() │ │ │ │ │ -Out[37]: │ │ │ │ │ +Out[37]: │ │ │ │ │ [_images/plotting_quick_overview.png] │ │ │ │ │ Note the automatic labeling with names and units. Our effort in adding metadata │ │ │ │ │ attributes has paid off! Many aspects of these figures are customizable: see │ │ │ │ │ Plotting. │ │ │ │ │ ***** pandas¶ ***** │ │ │ │ │ Xarray objects can be easily converted to and from pandas objects using the │ │ │ │ │ to_series(), to_dataframe() and to_xarray() methods: │ │ │ ├── ./usr/share/doc/python-xarray-doc/html/searchindex.js │ │ │ │ ├── js-beautify {} │ │ │ │ │ @@ -146,75 +146,76 @@ │ │ │ │ │ "09038344": 4, │ │ │ │ │ "094": 22, │ │ │ │ │ "096": 22, │ │ │ │ │ "09705329": 4, │ │ │ │ │ "09t00": 6, │ │ │ │ │ "0alpha10": 36, │ │ │ │ │ "0c0dc80c25a9": 6, │ │ │ │ │ + "0c71a9942837": 26, │ │ │ │ │ "0e8985178ccc": 26, │ │ │ │ │ "0eb806e38f7f": [14, 15], │ │ │ │ │ "0f41191e8013": 28, │ │ │ │ │ "0th": [6, 22], │ │ │ │ │ "0x0l": 36, │ │ │ │ │ - "0xe12d79e8": 36, │ │ │ │ │ - "0xe1ee2c88": 28, │ │ │ │ │ - "0xe1f05c40": 28, │ │ │ │ │ - "0xe1f2a700": 28, │ │ │ │ │ - "0xe1f2b7a8": 28, │ │ │ │ │ - "0xe2023d78": 29, │ │ │ │ │ - "0xe209f928": 28, │ │ │ │ │ - "0xe209f958": 28, │ │ │ │ │ - "0xe209f988": 28, │ │ │ │ │ - "0xe209f9e8": 28, │ │ │ │ │ - "0xe209fa48": 28, │ │ │ │ │ - "0xe2148328": 28, │ │ │ │ │ - "0xe2148d00": 28, │ │ │ │ │ - "0xe2254478": 28, │ │ │ │ │ - "0xe2254598": 28, │ │ │ │ │ - "0xe22615c8": 28, │ │ │ │ │ - "0xe2261838": 28, │ │ │ │ │ - "0xe22618f8": 28, │ │ │ │ │ - "0xe2298ce8": 28, │ │ │ │ │ - "0xe22b31c0": 28, │ │ │ │ │ - "0xe22bebc8": 28, │ │ │ │ │ - "0xe22bef10": 28, │ │ │ │ │ - "0xe22cecb8": 28, │ │ │ │ │ - "0xe2435b20": 28, │ │ │ │ │ - "0xe2751e98": 28, │ │ │ │ │ - "0xe27abad8": 28, │ │ │ │ │ - "0xe27abf58": 28, │ │ │ │ │ - "0xe27b13e8": 28, │ │ │ │ │ - "0xe27b6cd0": 28, │ │ │ │ │ - "0xe2915610": 28, │ │ │ │ │ - "0xe291de50": 28, │ │ │ │ │ - "0xe291dec8": 28, │ │ │ │ │ - "0xe29532b0": 28, │ │ │ │ │ - "0xe2c48160": 28, │ │ │ │ │ - "0xe2c9ebf8": 26, │ │ │ │ │ - "0xe2cb7418": 26, │ │ │ │ │ - "0xe2cb7538": 26, │ │ │ │ │ - "0xe2cb7928": 26, │ │ │ │ │ - "0xe2cb7a78": 26, │ │ │ │ │ - "0xe3442ca0": 25, │ │ │ │ │ - "0xe557a568": 28, │ │ │ │ │ - "0xe55b30b8": 28, │ │ │ │ │ - "0xe55b8b68": 25, │ │ │ │ │ - "0xe55b8c10": 25, │ │ │ │ │ - "0xe55e2ce8": 24, │ │ │ │ │ - "0xe5763d60": 28, │ │ │ │ │ - "0xe5863070": 28, │ │ │ │ │ - "0xe7fb1250": 28, │ │ │ │ │ - "0xe7fb6ef8": 7, │ │ │ │ │ - "0xe7fbd2b0": 7, │ │ │ │ │ - "0xe7fc4c88": 26, │ │ │ │ │ - "0xe8188748": 28, │ │ │ │ │ - "0xe865f7f0": 25, │ │ │ │ │ - "0xe8774418": 26, │ │ │ │ │ - "0xe9089bf8": 16, │ │ │ │ │ - "0xf51e8838": 17, │ │ │ │ │ + "0xa0551ad8": 36, │ │ │ │ │ + "0xa0c16dc0": 28, │ │ │ │ │ + "0xa0c16ec8": 28, │ │ │ │ │ + "0xa11bfd78": 28, │ │ │ │ │ + "0xa129be68": 29, │ │ │ │ │ + "0xa1319a18": 28, │ │ │ │ │ + "0xa1319a48": 28, │ │ │ │ │ + "0xa1319a78": 28, │ │ │ │ │ + "0xa1319ad8": 28, │ │ │ │ │ + "0xa1319b38": 28, │ │ │ │ │ + "0xa13bf418": 28, │ │ │ │ │ + "0xa14d7970": 28, │ │ │ │ │ + "0xa14d7a18": 28, │ │ │ │ │ + "0xa14d7a30": 28, │ │ │ │ │ + "0xa152c2b0": 28, │ │ │ │ │ + "0xa1534a00": 28, │ │ │ │ │ + "0xa1534cb8": 28, │ │ │ │ │ + "0xa1542a30": 28, │ │ │ │ │ + "0xa1548568": 28, │ │ │ │ │ + "0xa1548688": 28, │ │ │ │ │ + "0xa16abfd0": 28, │ │ │ │ │ + "0xa1a1dbb0": 28, │ │ │ │ │ + "0xa1a20b98": 28, │ │ │ │ │ + "0xa1a20d78": 28, │ │ │ │ │ + "0xa1a20f88": 28, │ │ │ │ │ + "0xa1a23508": 28, │ │ │ │ │ + "0xa1a2e190": 28, │ │ │ │ │ + "0xa1b85a00": 28, │ │ │ │ │ + "0xa1b85ca0": 28, │ │ │ │ │ + "0xa1b8cf70": 28, │ │ │ │ │ + "0xa1bc43e8": 28, │ │ │ │ │ + "0xa1ec6be0": 28, │ │ │ │ │ + "0xa1f0f9e8": 26, │ │ │ │ │ + "0xa1f21298": 26, │ │ │ │ │ + "0xa1f214d8": 26, │ │ │ │ │ + "0xa1f21958": 26, │ │ │ │ │ + "0xa1f219e8": 26, │ │ │ │ │ + "0xa1f34910": 28, │ │ │ │ │ + "0xa26baca0": 28, │ │ │ │ │ + "0xa26bae50": 25, │ │ │ │ │ + "0xa4829430": 28, │ │ │ │ │ + "0xa48afd30": 25, │ │ │ │ │ + "0xa48afe38": 25, │ │ │ │ │ + "0xa49351a8": 26, │ │ │ │ │ + "0xa497e7c0": 28, │ │ │ │ │ + "0xa4bc6ce8": 24, │ │ │ │ │ + "0xa50b1fb8": 7, │ │ │ │ │ + "0xa50ba370": 7, │ │ │ │ │ + "0xa51066e8": 28, │ │ │ │ │ + "0xa5133c88": 26, │ │ │ │ │ + "0xa8148eb0": 25, │ │ │ │ │ + "0xa83ffbf8": 16, │ │ │ │ │ + "0xb3024688": 28, │ │ │ │ │ + "0xb305b9a0": 28, │ │ │ │ │ + "0xb3075f88": 28, │ │ │ │ │ + "0xb41db820": 17, │ │ │ │ │ "100": [3, 4, 6, 11, 12, 22, 25, 26, 28, 31, 36], │ │ │ │ │ "1000": [6, 36], │ │ │ │ │ "100000": 6, │ │ │ │ │ "1000x1000": 6, │ │ │ │ │ "1003": 4, │ │ │ │ │ "101": [4, 22, 28, 36], │ │ │ │ │ "101985": 26, │ │ │ │ │ @@ -399,15 +400,14 @@ │ │ │ │ │ "1970": [32, 36], │ │ │ │ │ "198": 16, │ │ │ │ │ "199": [16, 29], │ │ │ │ │ "1991": 36, │ │ │ │ │ "1999": 4, │ │ │ │ │ "19t00": 6, │ │ │ │ │ "1MS": 17, │ │ │ │ │ - "1a13d624": 26, │ │ │ │ │ "1c96aded89da": 10, │ │ │ │ │ "1d37fb2cd247": 24, │ │ │ │ │ "1d727aa86050": 28, │ │ │ │ │ "1e6": 4, │ │ │ │ │ "1st": 22, │ │ │ │ │ "200": [4, 16, 28, 31], │ │ │ │ │ "2000": [4, 7, 17, 18, 22, 25, 26, 27, 34, 35, 36], │ │ │ │ │ @@ -719,15 +719,14 @@ │ │ │ │ │ "41156272": 4, │ │ │ │ │ "41184582": 4, │ │ │ │ │ "41198807": 4, │ │ │ │ │ "412": 10, │ │ │ │ │ "4123": 4, │ │ │ │ │ "413": 10, │ │ │ │ │ "414": 22, │ │ │ │ │ - "4160": 26, │ │ │ │ │ "4162c0ac1db4": 28, │ │ │ │ │ "4167": 26, │ │ │ │ │ "417": 28, │ │ │ │ │ "41753485ddae": 28, │ │ │ │ │ "41d6431c1ce8": 26, │ │ │ │ │ "424": 27, │ │ │ │ │ "425": 4, │ │ │ │ │ @@ -788,14 +787,15 @@ │ │ │ │ │ "4867138": 4, │ │ │ │ │ "48671934": 4, │ │ │ │ │ "48672119": 4, │ │ │ │ │ "492914": 17, │ │ │ │ │ "494929": 27, │ │ │ │ │ "495": 27, │ │ │ │ │ "497": 22, │ │ │ │ │ + "4c17": 26, │ │ │ │ │ "500": [16, 26, 28, 36], │ │ │ │ │ "501": 29, │ │ │ │ │ "5011": 3, │ │ │ │ │ "502": 25, │ │ │ │ │ "504": 19, │ │ │ │ │ "506234": 17, │ │ │ │ │ "508": 25, │ │ │ │ │ @@ -881,14 +881,15 @@ │ │ │ │ │ "609": 19, │ │ │ │ │ "60f8bca41fc7": 28, │ │ │ │ │ "6106": 4, │ │ │ │ │ "610f8fdf815a": 28, │ │ │ │ │ "611": 22, │ │ │ │ │ "612e": 26, │ │ │ │ │ "613": 22, │ │ │ │ │ + "616fe0734e26416bb4b6b0639e0646cdtemperatur": 6, │ │ │ │ │ "621": 26, │ │ │ │ │ "624": 29, │ │ │ │ │ "625": 26, │ │ │ │ │ "62b0a60dbc78": 28, │ │ │ │ │ "635": [25, 29], │ │ │ │ │ "63593435": 17, │ │ │ │ │ "636": 17, │ │ │ │ │ @@ -1029,24 +1030,23 @@ │ │ │ │ │ "82979374": 4, │ │ │ │ │ "829e": 6, │ │ │ │ │ "82f9ba4c4771": 22, │ │ │ │ │ "833": [26, 27], │ │ │ │ │ "8333": [25, 26], │ │ │ │ │ "8362b177be7e": 28, │ │ │ │ │ "839": 22, │ │ │ │ │ - "83a2": 26, │ │ │ │ │ "8402550832613813": 26, │ │ │ │ │ "8403": 19, │ │ │ │ │ "8415": 36, │ │ │ │ │ "8421": 17, │ │ │ │ │ "84210526": 17, │ │ │ │ │ "8434966": 17, │ │ │ │ │ + "84826c16": 26, │ │ │ │ │ "849": 4, │ │ │ │ │ "84b392f0a7d9": 28, │ │ │ │ │ - "84bc57f54340": 26, │ │ │ │ │ "853905": 17, │ │ │ │ │ "8548": 17, │ │ │ │ │ "85483871": 17, │ │ │ │ │ "858e": 35, │ │ │ │ │ "8598787065799693": 26, │ │ │ │ │ "8599": 22, │ │ │ │ │ "8601": [35, 36], │ │ │ │ │ @@ -1075,15 +1075,14 @@ │ │ │ │ │ "888": 25, │ │ │ │ │ "889425": 17, │ │ │ │ │ "892": 27, │ │ │ │ │ "893": 25, │ │ │ │ │ "897": [7, 22], │ │ │ │ │ "8972": [19, 26], │ │ │ │ │ "8972365243645735": 26, │ │ │ │ │ - "8991b1b144f62b67334e42d6ce128e3etemperatur": 6, │ │ │ │ │ "89bc1504b066": 28, │ │ │ │ │ "8ff3ba4430a3": 28, │ │ │ │ │ "9014": 4, │ │ │ │ │ "904": 7, │ │ │ │ │ "909": 7, │ │ │ │ │ "911": 25, │ │ │ │ │ "912": 25, │ │ │ │ │ @@ -1575,14 +1574,15 @@ │ │ │ │ │ azur: [5, 36], │ │ │ │ │ b0dd519cfb30: 28, │ │ │ │ │ b0e609ec01c0: 22, │ │ │ │ │ b193806a3ee8: 28, │ │ │ │ │ b347cf3a8c47: 28, │ │ │ │ │ b7284116c837: 15, │ │ │ │ │ b834aeff258: 28, │ │ │ │ │ + b8bf: 26, │ │ │ │ │ back: [4, 6, 7, 12, 18, 19, 22, 24, 26, 28, 29, 31, 36, 37], │ │ │ │ │ backend: [1, 6, 10, 16, 22, 23, 24, 26, 32, 36], │ │ │ │ │ backend_bas: 10, │ │ │ │ │ backend_kwarg: [26, 36], │ │ │ │ │ backfil: 22, │ │ │ │ │ background: [7, 32], │ │ │ │ │ backoff: 36, │ │ │ │ │ @@ -1728,15 +1728,14 @@ │ │ │ │ │ bytestr: 36, │ │ │ │ │ c46381dcb349: 12, │ │ │ │ │ c743efa1dcb: 28, │ │ │ │ │ c7d6afd7f8c5: 28, │ │ │ │ │ ca9ab8433617: 28, │ │ │ │ │ ca9decd7dd88: 28, │ │ │ │ │ cabl: 36, │ │ │ │ │ - cacf: 26, │ │ │ │ │ cach: [5, 10, 11, 12, 13, 14, 15, 16, 22, 24, 25, 28, 32, 36], │ │ │ │ │ cache_dir: [10, 11, 12, 13, 14, 15, 16, 22, 24, 25, 28], │ │ │ │ │ cachedir: 5, │ │ │ │ │ cachingfilemanag: 16, │ │ │ │ │ calcul: [4, 6, 9, 13, 15, 28, 30, 34, 36], │ │ │ │ │ caleb: 36, │ │ │ │ │ calendar: [14, 23, 25, 26, 34, 36], │ │ │ │ │ @@ -2462,14 +2461,15 @@ │ │ │ │ │ extent_geom: 10, │ │ │ │ │ extern: [1, 7, 8, 26, 32, 36], │ │ │ │ │ extra: [10, 12, 23, 36], │ │ │ │ │ extract: [6, 20, 31, 36], │ │ │ │ │ extrapol: [25, 36], │ │ │ │ │ extras_requir: 23, │ │ │ │ │ extrem: [6, 22, 26, 28], │ │ │ │ │ + f21f: 26, │ │ │ │ │ f2ef6402a2c4: 28, │ │ │ │ │ f4da044a917f: 28, │ │ │ │ │ f6219653038f: 12, │ │ │ │ │ f62677abb3ca: 25, │ │ │ │ │ f6e5aae51f8: 11, │ │ │ │ │ f75038449fe8: 28, │ │ │ │ │ f9603d06ba9e: 26, │ │ │ │ │ @@ -2545,15 +2545,15 @@ │ │ │ │ │ filter_by_attr: 36, │ │ │ │ │ financ: [32, 37], │ │ │ │ │ find: [0, 1, 5, 8, 18, 20, 22, 26, 28, 32, 36], │ │ │ │ │ fine: [5, 26], │ │ │ │ │ finish: [5, 36], │ │ │ │ │ finit: [4, 15, 30, 36], │ │ │ │ │ firm: 18, │ │ │ │ │ - first: [1, 3, 4, 5, 6, 7, 10, 11, 12, 13, 14, 15, 16, 17, 22, 23, 24, 25, 26, 28, 29, 32, 34, 36], │ │ │ │ │ + first: [1, 3, 4, 5, 6, 7, 12, 13, 14, 16, 17, 22, 23, 24, 25, 26, 28, 29, 32, 34, 36], │ │ │ │ │ fiscal: [21, 32, 36], │ │ │ │ │ fit: [6, 18, 26, 28, 32, 36], │ │ │ │ │ fitzgerald: [18, 36], │ │ │ │ │ five: [28, 36], │ │ │ │ │ fix: [1, 5, 6, 7, 12, 18, 23, 26, 28, 33, 35], │ │ │ │ │ fixtur: 5, │ │ │ │ │ flag: [5, 18, 36], │ │ │ │ │ @@ -4978,15 +4978,15 @@ │ │ │ │ │ seaborn: [23, 27, 28, 36], │ │ │ │ │ seamlessli: 5, │ │ │ │ │ search: [5, 26], │ │ │ │ │ searchsort: 1, │ │ │ │ │ season: [9, 17, 34, 35, 36], │ │ │ │ │ season_mean: 14, │ │ │ │ │ sec: 29, │ │ │ │ │ - second: [3, 5, 7, 12, 16, 22, 24, 26, 27, 29, 34, 35], │ │ │ │ │ + second: [3, 5, 7, 10, 11, 12, 13, 14, 15, 16, 22, 24, 25, 26, 27, 28, 29, 34, 35], │ │ │ │ │ section: [5, 11, 18, 23, 26, 28, 30, 36], │ │ │ │ │ see: [1, 3, 4, 5, 6, 7, 8, 11, 12, 16, 18, 20, 22, 23, 24, 25, 26, 27, 28, 29, 30, 32, 33, 34, 35, 36, 37], │ │ │ │ │ seed: 17, │ │ │ │ │ seem: [11, 12, 28, 36], │ │ │ │ │ seen: [4, 19, 23], │ │ │ │ │ segment: 36, │ │ │ │ │ seguinot: 36, │ │ │ ├── ./usr/share/doc/python-xarray-doc/html/whats-new.html │ │ │ │ @@ -4447,15 +4447,15 @@ │ │ │ │
  • New xray.Dataset.where method for masking xray objects according │ │ │ │ to some criteria. This works particularly well with multi-dimensional data:

    │ │ │ │
    In [44]: ds = xray.Dataset(coords={"x": range(100), "y": range(100)})
    │ │ │ │  
    │ │ │ │  In [45]: ds["distance"] = np.sqrt(ds.x ** 2 + ds.y ** 2)
    │ │ │ │  
    │ │ │ │  In [46]: ds.distance.where(ds.distance < 100).plot()
    │ │ │ │ -Out[46]: <matplotlib.collections.QuadMesh at 0xe12d79e8>
    │ │ │ │ +Out[46]: <matplotlib.collections.QuadMesh at 0xa0551ad8>
    │ │ │ │  
    │ │ │ │
    │ │ │ │ _images/where_example.png │ │ │ │
  • │ │ │ │
  • Added new methods xray.DataArray.diff and xray.Dataset.diff │ │ │ │ for finite difference calculations along a given axis.

  • │ │ │ │
  • New xray.DataArray.to_masked_array convenience method for │ │ │ │ ├── html2text {} │ │ │ │ │ @@ -2957,15 +2957,15 @@ │ │ │ │ │ * New xray.Dataset.where method for masking xray objects according to some │ │ │ │ │ criteria. This works particularly well with multi-dimensional data: │ │ │ │ │ In [44]: ds = xray.Dataset(coords={"x": range(100), "y": range(100)}) │ │ │ │ │ │ │ │ │ │ In [45]: ds["distance"] = np.sqrt(ds.x ** 2 + ds.y ** 2) │ │ │ │ │ │ │ │ │ │ In [46]: ds.distance.where(ds.distance < 100).plot() │ │ │ │ │ - Out[46]: │ │ │ │ │ + Out[46]: │ │ │ │ │ [_images/where_example.png] │ │ │ │ │ * Added new methods xray.DataArray.diff and xray.Dataset.diff for finite │ │ │ │ │ difference calculations along a given axis. │ │ │ │ │ * New xray.DataArray.to_masked_array convenience method for returning a │ │ │ │ │ numpy.ma.MaskedArray. │ │ │ │ │ In [47]: da = xray.DataArray(np.random.random_sample(size=(5, 4)))