Offset 1, 3 lines modified | Offset 1, 3 lines modified | ||
1 | · | 1 | ·818430b1efff05836954b02a711b4379·2044792·doc·optional·python-xarray-doc_0.16.2-2_all.deb |
2 | ·9a2456450e2c51d89ccb00d8c4a100d8·486600·python·optional·python3-xarray_0.16.2-2_all.deb | 2 | ·9a2456450e2c51d89ccb00d8c4a100d8·486600·python·optional·python3-xarray_0.16.2-2_all.deb |
Offset 1, 3 lines modified | Offset 1, 3 lines modified | ||
1 | -rw-r--r--···0········0········0········4·2021-01-02·13:06:33.000000·debian-binary | 1 | -rw-r--r--···0········0········0········4·2021-01-02·13:06:33.000000·debian-binary |
2 | -rw-r--r--···0········0········0·····498 | 2 | -rw-r--r--···0········0········0·····4980·2021-01-02·13:06:33.000000·control.tar.xz |
3 | -rw-r--r--···0········0········0··2039 | 3 | -rw-r--r--···0········0········0··2039620·2021-01-02·13:06:33.000000·data.tar.xz |
Offset 182, 50 lines modified | Offset 182, 50 lines modified | ||
182 | -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 | 182 | -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 |
183 | -rw-r--r--···0·root·········(0)·root·········(0)···110193·2021-01-02·13:06:33.000000·./usr/share/doc/python-xarray-doc/html/computation.html | 183 | -rw-r--r--···0·root·········(0)·root·········(0)···110193·2021-01-02·13:06:33.000000·./usr/share/doc/python-xarray-doc/html/computation.html |
184 | -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 | 184 | -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 |
185 | -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 | 185 | -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 |
186 | -rw-r--r--···0·root·········(0)·root·········(0)···102950·2021-01-02·13:06:33.000000·./usr/share/doc/python-xarray-doc/html/data-structures.html | 186 | -rw-r--r--···0·root·········(0)·root·········(0)···102950·2021-01-02·13:06:33.000000·./usr/share/doc/python-xarray-doc/html/data-structures.html |
187 | -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 | 187 | -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 |
188 | drwxr-xr-x···0·root·········(0)·root·········(0)········0·2021-01-02·13:06:33.000000·./usr/share/doc/python-xarray-doc/html/examples/ | 188 | drwxr-xr-x···0·root·········(0)·root·········(0)········0·2021-01-02·13:06:33.000000·./usr/share/doc/python-xarray-doc/html/examples/ |
189 | -rw-r--r--···0·root·········(0)·root·········(0)····6808 | 189 | -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 |
190 | -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 | 190 | -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 |
191 | -rw-r--r--···0·root·········(0)·root·········(0)····4951 | 191 | -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 |
192 | -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 | 192 | -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 |
193 | -rw-r--r--···0·root·········(0)·root·········(0)···1074 | 193 | -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 |
194 | -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 | 194 | -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 |
195 | -rw-r--r--···0·root·········(0)·root·········(0)····3821 | 195 | -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 |
196 | -rw-r--r--···0·root·········(0)·root·········(0)····1455 | 196 | -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 |
197 | -rw-r--r--···0·root·········(0)·root·········(0)····4784 | 197 | -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 |
198 | -rw-r--r--···0·root·········(0)·root·········(0)·····316 | 198 | -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 |
199 | -rw-r--r--···0·root·········(0)·root·········(0)····4191 | 199 | -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 |
200 | -rw-r--r--···0·root·········(0)·root·········(0)·····764 | 200 | -rw-r--r--···0·root·········(0)·root·········(0)·····7649·2021-01-02·13:06:33.000000·./usr/share/doc/python-xarray-doc/html/examples/multidimensional-coords.ipynb.gz |
201 | -rw-r--r--···0·root·········(0)·root·········(0)····8122 | 201 | -rw-r--r--···0·root·········(0)·root·········(0)····81221·2021-01-02·13:06:33.000000·./usr/share/doc/python-xarray-doc/html/examples/visualization_gallery.html |
202 | -rw-r--r--···0·root·········(0)·root·········(0)·····530 | 202 | -rw-r--r--···0·root·········(0)·root·········(0)·····5305·2021-01-02·13:06:33.000000·./usr/share/doc/python-xarray-doc/html/examples/visualization_gallery.ipynb.gz |
203 | -rw-r--r--···0·root·········(0)·root·········(0)····90739·2021-01-02·13:06:33.000000·./usr/share/doc/python-xarray-doc/html/examples/weather-data.html | 203 | -rw-r--r--···0·root·········(0)·root·········(0)····90739·2021-01-02·13:06:33.000000·./usr/share/doc/python-xarray-doc/html/examples/weather-data.html |
204 | -rw-r--r--···0·root·········(0)·root·········(0)···20863 | 204 | -rw-r--r--···0·root·········(0)·root·········(0)···208631·2021-01-02·13:06:33.000000·./usr/share/doc/python-xarray-doc/html/examples/weather-data.ipynb.gz |
205 | -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 | 205 | -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 |
206 | -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 | 206 | -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 |
207 | -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 | 207 | -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 |
208 | -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 | 208 | -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 |
209 | -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 | 209 | -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 |
210 | -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 | 210 | -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 |
211 | -rw-r--r--···0·root·········(0)·root·········(0)···18301 | 211 | -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 |
212 | -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 | 212 | -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 |
213 | -rw-r--r--···0·root·········(0)·root·········(0)····3415 | 213 | -rw-r--r--···0·root·········(0)·root·········(0)····34153·2021-01-02·13:06:33.000000·./usr/share/doc/python-xarray-doc/html/internals.html |
214 | -rw-r--r--···0·root·········(0)·root·········(0)····8997 | 214 | -rw-r--r--···0·root·········(0)·root·········(0)····89978·2021-01-02·13:06:33.000000·./usr/share/doc/python-xarray-doc/html/interpolation.html |
215 | -rw-r--r--···0·root·········(0)·root·········(0)···125247·2021-01-02·13:06:33.000000·./usr/share/doc/python-xarray-doc/html/io.html | 215 | -rw-r--r--···0·root·········(0)·root·········(0)···125247·2021-01-02·13:06:33.000000·./usr/share/doc/python-xarray-doc/html/io.html |
216 | -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 | 216 | -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 |
217 | -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 | 217 | -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 |
218 | -rw-r--r--···0·root·········(0)·root·········(0)···20868 | 218 | -rw-r--r--···0·root·········(0)·root·········(0)···208689·2021-01-02·13:06:33.000000·./usr/share/doc/python-xarray-doc/html/plotting.html |
219 | -rw-r--r--···0·root·········(0)·root·········(0)····46141·2021-01-02·13:06:33.000000·./usr/share/doc/python-xarray-doc/html/quick-overview.html | 219 | -rw-r--r--···0·root·········(0)·root·········(0)····46141·2021-01-02·13:06:33.000000·./usr/share/doc/python-xarray-doc/html/quick-overview.html |
220 | -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 | 220 | -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 |
221 | -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 | 221 | -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 |
222 | -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 | 222 | -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 |
223 | -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 | 223 | -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 |
224 | -rw-r--r--···0·root·········(0)·root·········(0)···1005 | 224 | -rw-r--r--···0·root·········(0)·root·········(0)···100592·2021-01-02·13:06:33.000000·./usr/share/doc/python-xarray-doc/html/searchindex.js |
225 | -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 | 225 | -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 |
226 | -rw-r--r--···0·root·········(0)·root·········(0)····39824·2021-01-02·13:06:33.000000·./usr/share/doc/python-xarray-doc/html/time-series.html | 226 | -rw-r--r--···0·root·········(0)·root·········(0)····39824·2021-01-02·13:06:33.000000·./usr/share/doc/python-xarray-doc/html/time-series.html |
227 | -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 | 227 | -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 |
228 | -rw-r--r--···0·root·········(0)·root·········(0)···574383·2021-01-02·13:06:33.000000·./usr/share/doc/python-xarray-doc/html/whats-new.html | 228 | -rw-r--r--···0·root·········(0)·root·········(0)···574383·2021-01-02·13:06:33.000000·./usr/share/doc/python-xarray-doc/html/whats-new.html |
229 | -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 | 229 | -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 |
230 | drwxr-xr-x···0·root·········(0)·root·········(0)········0·2021-01-02·13:06:33.000000·./usr/share/doc-base/ | 230 | drwxr-xr-x···0·root·········(0)·root·········(0)········0·2021-01-02·13:06:33.000000·./usr/share/doc-base/ |
231 | -rw-r--r--···0·root·········(0)·root·········(0)······290·2021-01-02·13:06:33.000000·./usr/share/doc-base/python-xarray-doc | 231 | -rw-r--r--···0·root·········(0)·root·········(0)······290·2021-01-02·13:06:33.000000·./usr/share/doc-base/python-xarray-doc |
Offset 300, 15 lines modified | Offset 300, 15 lines modified | ||
300 | <p>You’ll·notice·that·printing·a·dataset·still·shows·a·preview·of·array·values, | 300 | <p>You’ll·notice·that·printing·a·dataset·still·shows·a·preview·of·array·values, |
301 | even·if·they·are·actually·Dask·arrays.·We·can·do·this·quickly·with·Dask·because | 301 | even·if·they·are·actually·Dask·arrays.·We·can·do·this·quickly·with·Dask·because |
302 | we·only·need·to·compute·the·first·few·values·(typically·from·the·first·block). | 302 | we·only·need·to·compute·the·first·few·values·(typically·from·the·first·block). |
303 | To·reveal·the·true·nature·of·an·array,·print·a·DataArray:</p> | 303 | To·reveal·the·true·nature·of·an·array,·print·a·DataArray:</p> |
304 | <div·class="highlight-ipython·notranslate"><div·class="highlight"><pre><span></span><span·class="gp">In·[3]:·</span><span·class="n">ds</span><span·class="o">.</span><span·class="n">temperature</span> | 304 | <div·class="highlight-ipython·notranslate"><div·class="highlight"><pre><span></span><span·class="gp">In·[3]:·</span><span·class="n">ds</span><span·class="o">.</span><span·class="n">temperature</span> |
305 | <span·class="gh">Out[3]:·</span><span·class="go"></span> | 305 | <span·class="gh">Out[3]:·</span><span·class="go"></span> |
306 | <span·class="go"><xarray.DataArray·'temperature'·(time:·30,·latitude:·180,·longitude:·180)></span> | 306 | <span·class="go"><xarray.DataArray·'temperature'·(time:·30,·latitude:·180,·longitude:·180)></span> |
307 | <span·class="go">dask.array<open_dataset- | 307 | <span·class="go">dask.array<open_dataset-277162681b3377c87ddac5999bf33daetemperature,·shape=(30,·180,·180),·dtype=float64,·chunksize=(10,·180,·180),·chunktype=numpy.ndarray></span> |
308 | <span·class="go">Coordinates:</span> | 308 | <span·class="go">Coordinates:</span> |
309 | <span·class="go">··*·time·······(time)·datetime64[ns]·2015-01-01·2015-01-02·...·2015-01-30</span> | 309 | <span·class="go">··*·time·······(time)·datetime64[ns]·2015-01-01·2015-01-02·...·2015-01-30</span> |
310 | <span·class="go">··*·longitude··(longitude)·int64·0·1·2·3·4·5·6·7·...·173·174·175·176·177·178·179</span> | 310 | <span·class="go">··*·longitude··(longitude)·int64·0·1·2·3·4·5·6·7·...·173·174·175·176·177·178·179</span> |
311 | <span·class="go">··*·latitude···(latitude)·float64·89.5·88.5·87.5·86.5·...·-87.5·-88.5·-89.5</span> | 311 | <span·class="go">··*·latitude···(latitude)·float64·89.5·88.5·87.5·86.5·...·-87.5·-88.5·-89.5</span> |
312 | </pre></div> | 312 | </pre></div> |
313 | </div> | 313 | </div> |
314 | <p>Once·you’ve·manipulated·a·Dask·array,·you·can·still·write·a·dataset·too·big·to | 314 | <p>Once·you’ve·manipulated·a·Dask·array,·you·can·still·write·a·dataset·too·big·to |
Offset 114, 15 lines modified | Offset 114, 15 lines modified | ||
114 | Youâll·notice·that·printing·a·dataset·still·shows·a·preview·of·array·values, | 114 | Youâll·notice·that·printing·a·dataset·still·shows·a·preview·of·array·values, |
115 | even·if·they·are·actually·Dask·arrays.·We·can·do·this·quickly·with·Dask·because | 115 | even·if·they·are·actually·Dask·arrays.·We·can·do·this·quickly·with·Dask·because |
116 | we·only·need·to·compute·the·first·few·values·(typically·from·the·first·block). | 116 | we·only·need·to·compute·the·first·few·values·(typically·from·the·first·block). |
117 | To·reveal·the·true·nature·of·an·array,·print·a·DataArray: | 117 | To·reveal·the·true·nature·of·an·array,·print·a·DataArray: |
118 | In·[3]:·ds.temperature | 118 | In·[3]:·ds.temperature |
119 | Out[3]: | 119 | Out[3]: |
120 | <xarray.DataArray·'temperature'·(time:·30,·latitude:·180,·longitude:·180)> | 120 | <xarray.DataArray·'temperature'·(time:·30,·latitude:·180,·longitude:·180)> |
121 | dask.array<open_dataset- | 121 | dask.array<open_dataset-277162681b3377c87ddac5999bf33daetemperature,·shape=(30, |
122 | 180,·180),·dtype=float64,·chunksize=(10,·180,·180),·chunktype=numpy.ndarray> | 122 | 180,·180),·dtype=float64,·chunksize=(10,·180,·180),·chunktype=numpy.ndarray> |
123 | Coordinates: | 123 | Coordinates: |
124 | ··*·time·······(time)·datetime64[ns]·2015-01-01·2015-01-02·...·2015-01-30 | 124 | ··*·time·······(time)·datetime64[ns]·2015-01-01·2015-01-02·...·2015-01-30 |
125 | ··*·longitude··(longitude)·int64·0·1·2·3·4·5·6·7·...·173·174·175·176·177·178 | 125 | ··*·longitude··(longitude)·int64·0·1·2·3·4·5·6·7·...·173·174·175·176·177·178 |
126 | 179 | 126 | 179 |
127 | ··*·latitude···(latitude)·float64·89.5·88.5·87.5·86.5·...·-87.5·-88.5·-89.5 | 127 | ··*·latitude···(latitude)·float64·89.5·88.5·87.5·86.5·...·-87.5·-88.5·-89.5 |
128 | Once·youâve·manipulated·a·Dask·array,·you·can·still·write·a·dataset·too·big | 128 | Once·youâve·manipulated·a·Dask·array,·you·can·still·write·a·dataset·too·big |
Offset 892, 18 lines modified | Offset 892, 18 lines modified | ||
892 | a·method·call·with·an·external·function·(e.g.,·<code·class="docutils·literal·notranslate"><span·class="pre">ds.pipe(func)</span></code>)·instead·of | 892 | a·method·call·with·an·external·function·(e.g.,·<code·class="docutils·literal·notranslate"><span·class="pre">ds.pipe(func)</span></code>)·instead·of |
893 | simply·calling·it·(e.g.,·<code·class="docutils·literal·notranslate"><span·class="pre">func(ds)</span></code>).·This·allows·you·to·write·pipelines·for | 893 | simply·calling·it·(e.g.,·<code·class="docutils·literal·notranslate"><span·class="pre">func(ds)</span></code>).·This·allows·you·to·write·pipelines·for |
894 | transforming·your·data·(using·“method·chaining”)·instead·of·writing·hard·to | 894 | transforming·your·data·(using·“method·chaining”)·instead·of·writing·hard·to |
895 | follow·nested·function·calls:</p> | 895 | follow·nested·function·calls:</p> |
896 | <div·class="highlight-ipython·notranslate"><div·class="highlight"><pre><span></span><span·class="go">#·these·lines·are·equivalent,·but·with·pipe·we·can·make·the·logic·flow</span> | 896 | <div·class="highlight-ipython·notranslate"><div·class="highlight"><pre><span></span><span·class="go">#·these·lines·are·equivalent,·but·with·pipe·we·can·make·the·logic·flow</span> |
897 | <span·class="go">#·entirely·from·left·to·right</span> | 897 | <span·class="go">#·entirely·from·left·to·right</span> |
898 | <span·class="gp">In·[60]:·</span><span·class="n">plt</span><span·class="o">.</span><span·class="n">plot</span><span·class="p">((</span><span·class="mi">2</span>·<span·class="o">*</span>·<span·class="n">ds</span><span·class="o">.</span><span·class="n">temperature</span><span·class="o">.</span><span·class="n">sel</span><span·class="p">(</span><span·class="n">x</span><span·class="o">=</span><span·class="mi">0</span><span·class="p">))</span><span·class="o">.</span><span·class="n">mean</span><span·class="p">(</span><span·class="s2">"y"</span><span·class="p">))</span> | 898 | <span·class="gp">In·[60]:·</span><span·class="n">plt</span><span·class="o">.</span><span·class="n">plot</span><span·class="p">((</span><span·class="mi">2</span>·<span·class="o">*</span>·<span·class="n">ds</span><span·class="o">.</span><span·class="n">temperature</span><span·class="o">.</span><span·class="n">sel</span><span·class="p">(</span><span·class="n">x</span><span·class="o">=</span><span·class="mi">0</span><span·class="p">))</span><span·class="o">.</span><span·class="n">mean</span><span·class="p">(</span><span·class="s2">"y"</span><span·class="p">))</span> |
899 | <span·class="gh">Out[60]:·</span><span·class="go">[<matplotlib.lines.Line2D·at·0xffff | 899 | <span·class="gh">Out[60]:·</span><span·class="go">[<matplotlib.lines.Line2D·at·0xffff689d4fa0>]</span> |
900 | <span·class="gp">In·[61]:·</span><span·class="p">(</span><span·class="n">ds</span><span·class="o">.</span><span·class="n">temperature</span><span·class="o">.</span><span·class="n">sel</span><span·class="p">(</span><span·class="n">x</span><span·class="o">=</span><span·class="mi">0</span><span·class="p">)</span><span·class="o">.</span><span·class="n">pipe</span><span·class="p">(</span><span·class="k">lambda</span>·<span·class="n">x</span><span·class="p">:</span>·<span·class="mi">2</span>·<span·class="o">*</span>·<span·class="n">x</span><span·class="p">)</span><span·class="o">.</span><span·class="n">mean</span><span·class="p">(</span><span·class="s2">"y"</span><span·class="p">)</span><span·class="o">.</span><span·class="n">pipe</span><span·class="p">(</span><span·class="n">plt</span><span·class="o">.</span><span·class="n">plot</span><span·class="p">))</span> | 900 | <span·class="gp">In·[61]:·</span><span·class="p">(</span><span·class="n">ds</span><span·class="o">.</span><span·class="n">temperature</span><span·class="o">.</span><span·class="n">sel</span><span·class="p">(</span><span·class="n">x</span><span·class="o">=</span><span·class="mi">0</span><span·class="p">)</span><span·class="o">.</span><span·class="n">pipe</span><span·class="p">(</span><span·class="k">lambda</span>·<span·class="n">x</span><span·class="p">:</span>·<span·class="mi">2</span>·<span·class="o">*</span>·<span·class="n">x</span><span·class="p">)</span><span·class="o">.</span><span·class="n">mean</span><span·class="p">(</span><span·class="s2">"y"</span><span·class="p">)</span><span·class="o">.</span><span·class="n">pipe</span><span·class="p">(</span><span·class="n">plt</span><span·class="o">.</span><span·class="n">plot</span><span·class="p">))</span> |
901 | <span·class="gh">Out[61]:·</span><span·class="go">[<matplotlib.lines.Line2D·at·0xffff | 901 | <span·class="gh">Out[61]:·</span><span·class="go">[<matplotlib.lines.Line2D·at·0xffff689df2e0>]</span> |
902 | </pre></div> | 902 | </pre></div> |
903 | </div> | 903 | </div> |
904 | <p>Both·<code·class="docutils·literal·notranslate"><span·class="pre">pipe</span></code>·and·<code·class="docutils·literal·notranslate"><span·class="pre">assign</span></code>·replicate·the·pandas·methods·of·the·same·names | 904 | <p>Both·<code·class="docutils·literal·notranslate"><span·class="pre">pipe</span></code>·and·<code·class="docutils·literal·notranslate"><span·class="pre">assign</span></code>·replicate·the·pandas·methods·of·the·same·names |
905 | (<a·class="reference·external"·href="http://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.pipe.html#pandas.DataFrame.pipe"·title="(in·pandas·v1.1.5)"><code·class="xref·py·py-meth·docutils·literal·notranslate"><span·class="pre">DataFrame.pipe</span></code></a>·and | 905 | (<a·class="reference·external"·href="http://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.pipe.html#pandas.DataFrame.pipe"·title="(in·pandas·v1.1.5)"><code·class="xref·py·py-meth·docutils·literal·notranslate"><span·class="pre">DataFrame.pipe</span></code></a>·and |
906 | <a·class="reference·external"·href="http://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.assign.html#pandas.DataFrame.assign"·title="(in·pandas·v1.1.5)"><code·class="xref·py·py-meth·docutils·literal·notranslate"><span·class="pre">DataFrame.assign</span></code></a>).</p> | 906 | <a·class="reference·external"·href="http://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.assign.html#pandas.DataFrame.assign"·title="(in·pandas·v1.1.5)"><code·class="xref·py·py-meth·docutils·literal·notranslate"><span·class="pre">DataFrame.assign</span></code></a>).</p> |
907 | <p>With·xarray,·there·is·no·performance·penalty·for·creating·new·datasets,·even·if | 907 | <p>With·xarray,·there·is·no·performance·penalty·for·creating·new·datasets,·even·if |
908 | variables·are·lazily·loaded·from·a·file·on·disk.·Creating·new·objects·instead | 908 | variables·are·lazily·loaded·from·a·file·on·disk.·Creating·new·objects·instead |
Offset 619, 19 lines modified | Offset 619, 19 lines modified | ||
619 | There·is·also·the·pipe()·method·that·allows·you·to·use·a·method·call·with·an | 619 | There·is·also·the·pipe()·method·that·allows·you·to·use·a·method·call·with·an |
620 | external·function·(e.g.,·ds.pipe(func))·instead·of·simply·calling·it·(e.g., | 620 | external·function·(e.g.,·ds.pipe(func))·instead·of·simply·calling·it·(e.g., |
621 | func(ds)).·This·allows·you·to·write·pipelines·for·transforming·your·data·(using | 621 | func(ds)).·This·allows·you·to·write·pipelines·for·transforming·your·data·(using |
622 | âmethod·chainingâ)·instead·of·writing·hard·to·follow·nested·function·calls: | 622 | âmethod·chainingâ)·instead·of·writing·hard·to·follow·nested·function·calls: |
623 | #·these·lines·are·equivalent,·but·with·pipe·we·can·make·the·logic·flow | 623 | #·these·lines·are·equivalent,·but·with·pipe·we·can·make·the·logic·flow |
624 | #·entirely·from·left·to·right | 624 | #·entirely·from·left·to·right |
625 | In·[60]:·plt.plot((2·*·ds.temperature.sel(x=0)).mean("y")) | 625 | In·[60]:·plt.plot((2·*·ds.temperature.sel(x=0)).mean("y")) |
626 | Out[60]:·[<matplotlib.lines.Line2D·at·0xffff | 626 | Out[60]:·[<matplotlib.lines.Line2D·at·0xffff689d4fa0>] |
627 | In·[61]:·(ds.temperature.sel(x=0).pipe(lambda·x:·2·*·x).mean("y").pipe | 627 | In·[61]:·(ds.temperature.sel(x=0).pipe(lambda·x:·2·*·x).mean("y").pipe |
628 | (plt.plot)) | 628 | (plt.plot)) |
629 | Out[61]:·[<matplotlib.lines.Line2D·at·0xffff | 629 | Out[61]:·[<matplotlib.lines.Line2D·at·0xffff689df2e0>] |
630 | Both·pipe·and·assign·replicate·the·pandas·methods·of·the·same·names | 630 | Both·pipe·and·assign·replicate·the·pandas·methods·of·the·same·names |
631 | (DataFrame.pipe·and·DataFrame.assign). | 631 | (DataFrame.pipe·and·DataFrame.assign). |
632 | With·xarray,·there·is·no·performance·penalty·for·creating·new·datasets,·even·if | 632 | With·xarray,·there·is·no·performance·penalty·for·creating·new·datasets,·even·if |
633 | variables·are·lazily·loaded·from·a·file·on·disk.·Creating·new·objects·instead | 633 | variables·are·lazily·loaded·from·a·file·on·disk.·Creating·new·objects·instead |
634 | of·mutating·existing·objects·often·results·in·easier·to·understand·code,·so·we | 634 | of·mutating·existing·objects·often·results·in·easier·to·understand·code,·so·we |
635 | encourage·using·this·approach. | 635 | encourage·using·this·approach. |
636 | ****·Renaming·variables¶·**** | 636 | ****·Renaming·variables¶·**** |
Offset 523, 15 lines modified | Offset 523, 15 lines modified | ||
523 | <span·class="ansi-green-fg">/build/reproducible-path/python-xarray-0.16.2/xarray/tutorial.py</span>·in·<span·class="ansi-cyan-fg">open_dataset</span><span·class="ansi-blue-fg">(name,·cache,·cache_dir,·github_url,·branch,·**kws)</span> | 523 | <span·class="ansi-green-fg">/build/reproducible-path/python-xarray-0.16.2/xarray/tutorial.py</span>·in·<span·class="ansi-cyan-fg">open_dataset</span><span·class="ansi-blue-fg">(name,·cache,·cache_dir,·github_url,·branch,·**kws)</span> |
524 | <span·class="ansi-green-intense-fg·ansi-bold">·····76</span>·········<span·class="ansi-red-fg">#·May·want·to·add·an·option·to·remove·it.</span> | 524 | <span·class="ansi-green-intense-fg·ansi-bold">·····76</span>·········<span·class="ansi-red-fg">#·May·want·to·add·an·option·to·remove·it.</span> |
525 | <span·class="ansi-green-intense-fg·ansi-bold">·····77</span>·········<span·class="ansi-green-fg">if</span>·<span·class="ansi-green-fg">not</span>·_os<span·class="ansi-blue-fg">.</span>path<span·class="ansi-blue-fg">.</span>isdir<span·class="ansi-blue-fg">(</span>longdir<span·class="ansi-blue-fg">)</span><span·class="ansi-blue-fg">:</span> | 525 | <span·class="ansi-green-intense-fg·ansi-bold">·····77</span>·········<span·class="ansi-green-fg">if</span>·<span·class="ansi-green-fg">not</span>·_os<span·class="ansi-blue-fg">.</span>path<span·class="ansi-blue-fg">.</span>isdir<span·class="ansi-blue-fg">(</span>longdir<span·class="ansi-blue-fg">)</span><span·class="ansi-blue-fg">:</span> |
526 | <span·class="ansi-green-fg">--->·78</span><span·class="ansi-red-fg">·············</span>_os<span·class="ansi-blue-fg">.</span>mkdir<span·class="ansi-blue-fg">(</span>longdir<span·class="ansi-blue-fg">)</span> | 526 | <span·class="ansi-green-fg">--->·78</span><span·class="ansi-red-fg">·············</span>_os<span·class="ansi-blue-fg">.</span>mkdir<span·class="ansi-blue-fg">(</span>longdir<span·class="ansi-blue-fg">)</span> |
527 | <span·class="ansi-green-intense-fg·ansi-bold">·····79</span> | 527 | <span·class="ansi-green-intense-fg·ansi-bold">·····79</span> |
528 | <span·class="ansi-green-intense-fg·ansi-bold">·····80</span>·········url·<span·class="ansi-blue-fg">=</span>·<span·class="ansi-blue-fg">"/"</span><span·class="ansi-blue-fg">.</span>join<span·class="ansi-blue-fg">(</span><span·class="ansi-blue-fg">(</span>github_url<span·class="ansi-blue-fg">,</span>·<span·class="ansi-blue-fg">"raw"</span><span·class="ansi-blue-fg">,</span>·branch<span·class="ansi-blue-fg">,</span>·fullname<span·class="ansi-blue-fg">)</span><span·class="ansi-blue-fg">)</span> | 528 | <span·class="ansi-green-intense-fg·ansi-bold">·····80</span>·········url·<span·class="ansi-blue-fg">=</span>·<span·class="ansi-blue-fg">"/"</span><span·class="ansi-blue-fg">.</span>join<span·class="ansi-blue-fg">(</span><span·class="ansi-blue-fg">(</span>github_url<span·class="ansi-blue-fg">,</span>·<span·class="ansi-blue-fg">"raw"</span><span·class="ansi-blue-fg">,</span>·branch<span·class="ansi-blue-fg">,</span>·fullname<span·class="ansi-blue-fg">)</span><span·class="ansi-blue-fg">)</span> |
529 | <span·class="ansi-red-fg">FileNotFoundError</span>:·[Errno·2]·No·such·file·or·directory:·'/nonexistent/ | 529 | <span·class="ansi-red-fg">FileNotFoundError</span>:·[Errno·2]·No·such·file·or·directory:·'/nonexistent/second-build/.xarray_tutorial_data' |
530 | </pre></div></div> | 530 | </pre></div></div> |
531 | </div> | 531 | </div> |
532 | <p>Let’s·create·a·simple·plot·of·2-m·air·temperature·in·degrees·Celsius:</p> | 532 | <p>Let’s·create·a·simple·plot·of·2-m·air·temperature·in·degrees·Celsius:</p> |
533 | <div·class="nbinput·docutils·container"> | 533 | <div·class="nbinput·docutils·container"> |
534 | <div·class="prompt·highlight-none·notranslate"><div·class="highlight"><pre><span></span>[3]: | 534 | <div·class="prompt·highlight-none·notranslate"><div·class="highlight"><pre><span></span>[3]: |
535 | </pre></div> | 535 | </pre></div> |
536 | </div> | 536 | </div> |
Offset 84, 15 lines modified | Offset 84, 15 lines modified | ||
84 | open_dataset(name,·cache,·cache_dir,·github_url,·branch,·**kws) | 84 | open_dataset(name,·cache,·cache_dir,·github_url,·branch,·**kws) |
85 | ·····76·········#·May·want·to·add·an·option·to·remove·it. | 85 | ·····76·········#·May·want·to·add·an·option·to·remove·it. |
86 | ·····77·········if·not·_os.path.isdir(longdir): | 86 | ·····77·········if·not·_os.path.isdir(longdir): |
87 | --->·78·············_os.mkdir(longdir) | 87 | --->·78·············_os.mkdir(longdir) |
88 | ·····79 | 88 | ·····79 |
89 | ·····80·········url·=·"/".join((github_url,·"raw",·branch,·fullname)) | 89 | ·····80·········url·=·"/".join((github_url,·"raw",·branch,·fullname)) |
90 | FileNotFoundError:·[Errno·2]·No·such·file·or·directory:·'/nonexistent/ | 90 | FileNotFoundError:·[Errno·2]·No·such·file·or·directory:·'/nonexistent/second- |
91 | build/.xarray_tutorial_data' | 91 | build/.xarray_tutorial_data' |
92 | Letâs·create·a·simple·plot·of·2-m·air·temperature·in·degrees·Celsius: | 92 | Letâs·create·a·simple·plot·of·2-m·air·temperature·in·degrees·Celsius: |
93 | [3]: | 93 | [3]: |
94 | ds·=·ds·-·273.15 | 94 | ds·=·ds·-·273.15 |
95 | ds.t2m[0].plot(cmap=plt.cm.coolwarm) | 95 | ds.t2m[0].plot(cmap=plt.cm.coolwarm) |
96 | --------------------------------------------------------------------------- | 96 | --------------------------------------------------------------------------- |
97 | NameError·································Traceback·(most·recent·call·last) | 97 | NameError·································Traceback·(most·recent·call·last) |
Offset 34, 23 lines modified | Offset 34, 23 lines modified | ||
34 | ········{ | 34 | ········{ |
35 | ············"cell_type":·"code", | 35 | ············"cell_type":·"code", |
36 | ············"execution_count":·2, | 36 | ············"execution_count":·2, |
37 | ············"metadata":·{}, | 37 | ············"metadata":·{}, |
38 | ············"outputs":·[ | 38 | ············"outputs":·[ |
39 | ················{ | 39 | ················{ |
40 | ····················"ename":·"FileNotFoundError", | 40 | ····················"ename":·"FileNotFoundError", |
41 | ····················"evalue":·"[Errno·2]·No·such·file·or·directory:·'/nonexistent/ | 41 | ····················"evalue":·"[Errno·2]·No·such·file·or·directory:·'/nonexistent/second-build/.xarray_tutorial_data'", |
42 | ····················"output_type":·"error", | 42 | ····················"output_type":·"error", |
43 | ····················"traceback":·[ | 43 | ····················"traceback":·[ |
44 | ························"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", | 44 | ························"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", |
45 | ························"\u001b[0;31mFileNotFoundError\u001b[0m·························Traceback·(most·recent·call·last)", | 45 | ························"\u001b[0;31mFileNotFoundError\u001b[0m·························Traceback·(most·recent·call·last)", |
46 | ························"\u001b[0;32m<ipython-input-2-783584127f97>\u001b[0m·in·\u001b[0;36m<module>\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", | 46 | ························"\u001b[0;32m<ipython-input-2-783584127f97>\u001b[0m·in·\u001b[0;36m<module>\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", |
47 | ························"\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", | 47 | ························"\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", |
48 | ························"\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", | 48 | ························"\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", |
49 | ························"\u001b[0;31mFileNotFoundError\u001b[0m:·[Errno·2]·No·such·file·or·directory:·'/nonexistent/ | 49 | ························"\u001b[0;31mFileNotFoundError\u001b[0m:·[Errno·2]·No·such·file·or·directory:·'/nonexistent/second-build/.xarray_tutorial_data'" |
50 | ····················] | 50 | ····················] |
51 | ················} | 51 | ················} |
52 | ············], | 52 | ············], |
53 | ············"source":·[ | 53 | ············"source":·[ |
54 | ················"ds·=·xr.tutorial.load_dataset('era5-2mt-2019-03-uk.grib',·engine='cfgrib')" | 54 | ················"ds·=·xr.tutorial.load_dataset('era5-2mt-2019-03-uk.grib',·engine='cfgrib')" |
55 | ············] | 55 | ············] |
56 | ········}, | 56 | ········}, |
Offset 561, 15 lines modified | Offset 561, 15 lines modified | ||
561 | <span·class="ansi-green-fg">/build/reproducible-path/python-xarray-0.16.2/xarray/tutorial.py</span>·in·<span·class="ansi-cyan-fg">open_dataset</span><span·class="ansi-blue-fg">(name,·cache,·cache_dir,·github_url,·branch,·**kws)</span> | 561 | <span·class="ansi-green-fg">/build/reproducible-path/python-xarray-0.16.2/xarray/tutorial.py</span>·in·<span·class="ansi-cyan-fg">open_dataset</span><span·class="ansi-blue-fg">(name,·cache,·cache_dir,·github_url,·branch,·**kws)</span> |
562 | <span·class="ansi-green-intense-fg·ansi-bold">·····76</span>·········<span·class="ansi-red-fg">#·May·want·to·add·an·option·to·remove·it.</span> | 562 | <span·class="ansi-green-intense-fg·ansi-bold">·····76</span>·········<span·class="ansi-red-fg">#·May·want·to·add·an·option·to·remove·it.</span> |
563 | <span·class="ansi-green-intense-fg·ansi-bold">·····77</span>·········<span·class="ansi-green-fg">if</span>·<span·class="ansi-green-fg">not</span>·_os<span·class="ansi-blue-fg">.</span>path<span·class="ansi-blue-fg">.</span>isdir<span·class="ansi-blue-fg">(</span>longdir<span·class="ansi-blue-fg">)</span><span·class="ansi-blue-fg">:</span> | 563 | <span·class="ansi-green-intense-fg·ansi-bold">·····77</span>·········<span·class="ansi-green-fg">if</span>·<span·class="ansi-green-fg">not</span>·_os<span·class="ansi-blue-fg">.</span>path<span·class="ansi-blue-fg">.</span>isdir<span·class="ansi-blue-fg">(</span>longdir<span·class="ansi-blue-fg">)</span><span·class="ansi-blue-fg">:</span> |
564 | <span·class="ansi-green-fg">--->·78</span><span·class="ansi-red-fg">·············</span>_os<span·class="ansi-blue-fg">.</span>mkdir<span·class="ansi-blue-fg">(</span>longdir<span·class="ansi-blue-fg">)</span> | 564 | <span·class="ansi-green-fg">--->·78</span><span·class="ansi-red-fg">·············</span>_os<span·class="ansi-blue-fg">.</span>mkdir<span·class="ansi-blue-fg">(</span>longdir<span·class="ansi-blue-fg">)</span> |
565 | <span·class="ansi-green-intense-fg·ansi-bold">·····79</span> | 565 | <span·class="ansi-green-intense-fg·ansi-bold">·····79</span> |
566 | <span·class="ansi-green-intense-fg·ansi-bold">·····80</span>·········url·<span·class="ansi-blue-fg">=</span>·<span·class="ansi-blue-fg">"/"</span><span·class="ansi-blue-fg">.</span>join<span·class="ansi-blue-fg">(</span><span·class="ansi-blue-fg">(</span>github_url<span·class="ansi-blue-fg">,</span>·<span·class="ansi-blue-fg">"raw"</span><span·class="ansi-blue-fg">,</span>·branch<span·class="ansi-blue-fg">,</span>·fullname<span·class="ansi-blue-fg">)</span><span·class="ansi-blue-fg">)</span> | 566 | <span·class="ansi-green-intense-fg·ansi-bold">·····80</span>·········url·<span·class="ansi-blue-fg">=</span>·<span·class="ansi-blue-fg">"/"</span><span·class="ansi-blue-fg">.</span>join<span·class="ansi-blue-fg">(</span><span·class="ansi-blue-fg">(</span>github_url<span·class="ansi-blue-fg">,</span>·<span·class="ansi-blue-fg">"raw"</span><span·class="ansi-blue-fg">,</span>·branch<span·class="ansi-blue-fg">,</span>·fullname<span·class="ansi-blue-fg">)</span><span·class="ansi-blue-fg">)</span> |
567 | <span·class="ansi-red-fg">FileNotFoundError</span>:·[Errno·2]·No·such·file·or·directory:·'/nonexistent/ | 567 | <span·class="ansi-red-fg">FileNotFoundError</span>:·[Errno·2]·No·such·file·or·directory:·'/nonexistent/second-build/.xarray_tutorial_data' |
568 | </pre></div></div> | 568 | </pre></div></div> |
569 | </div> | 569 | </div> |
570 | </div> | 570 | </div> |
571 | <div·class="section"·id="Add-a-lazilly-calculated-vertical-coordinates"> | 571 | <div·class="section"·id="Add-a-lazilly-calculated-vertical-coordinates"> |
572 | <h2>Add·a·lazilly·calculated·vertical·coordinates<a·class="headerlink"·href="#Add-a-lazilly-calculated-vertical-coordinates"·title="Permalink·to·this·headline">¶</a></h2> | 572 | <h2>Add·a·lazilly·calculated·vertical·coordinates<a·class="headerlink"·href="#Add-a-lazilly-calculated-vertical-coordinates"·title="Permalink·to·this·headline">¶</a></h2> |
573 | <p>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)[<a·class="reference·external"·href="https://www.myroms.org/wiki/Vertical_S-coordinate">https://www.myroms.org/wiki/Vertical_S-coordinate</a>]</p> | 573 | <p>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)[<a·class="reference·external"·href="https://www.myroms.org/wiki/Vertical_S-coordinate">https://www.myroms.org/wiki/Vertical_S-coordinate</a>]</p> |
574 | <p>In·short,·for·<code·class="docutils·literal·notranslate"><span·class="pre">Vtransform==2</span></code>·as·used·in·this·example,</p> | 574 | <p>In·short,·for·<code·class="docutils·literal·notranslate"><span·class="pre">Vtransform==2</span></code>·as·used·in·this·example,</p> |
Offset 125, 15 lines modified | Offset 125, 15 lines modified | ||
125 | open_dataset(name,·cache,·cache_dir,·github_url,·branch,·**kws) | 125 | open_dataset(name,·cache,·cache_dir,·github_url,·branch,·**kws) |
126 | ·····76·········#·May·want·to·add·an·option·to·remove·it. | 126 | ·····76·········#·May·want·to·add·an·option·to·remove·it. |
127 | ·····77·········if·not·_os.path.isdir(longdir): | 127 | ·····77·········if·not·_os.path.isdir(longdir): |
128 | --->·78·············_os.mkdir(longdir) | 128 | --->·78·············_os.mkdir(longdir) |
129 | ·····79 | 129 | ·····79 |
130 | ·····80·········url·=·"/".join((github_url,·"raw",·branch,·fullname)) | 130 | ·····80·········url·=·"/".join((github_url,·"raw",·branch,·fullname)) |
131 | FileNotFoundError:·[Errno·2]·No·such·file·or·directory:·'/nonexistent/ | 131 | FileNotFoundError:·[Errno·2]·No·such·file·or·directory:·'/nonexistent/second- |
132 | build/.xarray_tutorial_data' | 132 | build/.xarray_tutorial_data' |
133 | *****·Add·a·lazilly·calculated·vertical·coordinates¶·***** | 133 | *****·Add·a·lazilly·calculated·vertical·coordinates¶·***** |
134 | Write·equations·to·calculate·the·vertical·coordinate.·These·will·be·only | 134 | Write·equations·to·calculate·the·vertical·coordinate.·These·will·be·only |
135 | evaluated·when·data·is·requested.·Information·about·the·ROMS·vertical | 135 | evaluated·when·data·is·requested.·Information·about·the·ROMS·vertical |
136 | coordinate·can·be·found·(here)[https://www.myroms.org/wiki/Vertical_S- | 136 | coordinate·can·be·found·(here)[https://www.myroms.org/wiki/Vertical_S- |
137 | coordinate] | 137 | coordinate] |
138 | In·short,·for·Vtransform==2·as·used·in·this·example, | 138 | In·short,·for·Vtransform==2·as·used·in·this·example, |
Offset 69, 22 lines modified | Offset 69, 22 lines modified | ||
69 | ········{ | 69 | ········{ |
70 | ············"cell_type":·"code", | 70 | ············"cell_type":·"code", |
71 | ············"execution_count":·2, | 71 | ············"execution_count":·2, |
72 | ············"metadata":·{}, | 72 | ············"metadata":·{}, |
73 | ············"outputs":·[ | 73 | ············"outputs":·[ |
74 | ················{ | 74 | ················{ |
75 | ····················"ename":·"FileNotFoundError", | 75 | ····················"ename":·"FileNotFoundError", |
76 | ····················"evalue":·"[Errno·2]·No·such·file·or·directory:·'/nonexistent/ | 76 | ····················"evalue":·"[Errno·2]·No·such·file·or·directory:·'/nonexistent/second-build/.xarray_tutorial_data'", |
77 | ····················"output_type":·"error", | 77 | ····················"output_type":·"error", |
78 | ····················"traceback":·[ | 78 | ····················"traceback":·[ |
79 | ························"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", | 79 | ························"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", |
80 | ························"\u001b[0;31mFileNotFoundError\u001b[0m·························Traceback·(most·recent·call·last)", | 80 | ························"\u001b[0;31mFileNotFoundError\u001b[0m·························Traceback·(most·recent·call·last)", |
81 | ························"\u001b[0;32m<ipython-input-2-f6e5aae51f8e>\u001b[0m·in·\u001b[0;36m<module>\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", | 81 | ························"\u001b[0;32m<ipython-input-2-f6e5aae51f8e>\u001b[0m·in·\u001b[0;36m<module>\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", |
82 | ························"\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", | 82 | ························"\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", |
83 | ························"\u001b[0;31mFileNotFoundError\u001b[0m:·[Errno·2]·No·such·file·or·directory:·'/nonexistent/ | 83 | ························"\u001b[0;31mFileNotFoundError\u001b[0m:·[Errno·2]·No·such·file·or·directory:·'/nonexistent/second-build/.xarray_tutorial_data'" |
84 | ····················] | 84 | ····················] |
85 | ················} | 85 | ················} |
86 | ············], | 86 | ············], |
87 | ············"source":·[ | 87 | ············"source":·[ |
88 | ················"#·load·in·the·file\n", | 88 | ················"#·load·in·the·file\n", |
89 | ················"ds·=·xr.tutorial.open_dataset('ROMS_example.nc',·chunks={'ocean_time':·1})\n", | 89 | ················"ds·=·xr.tutorial.open_dataset('ROMS_example.nc',·chunks={'ocean_time':·1})\n", |
90 | ················"\n", | 90 | ················"\n", |
Offset 555, 15 lines modified | Offset 555, 15 lines modified | ||
555 | <span·class="ansi-green-fg">/build/reproducible-path/python-xarray-0.16.2/xarray/tutorial.py</span>·in·<span·class="ansi-cyan-fg">open_dataset</span><span·class="ansi-blue-fg">(name,·cache,·cache_dir,·github_url,·branch,·**kws)</span> | 555 | <span·class="ansi-green-fg">/build/reproducible-path/python-xarray-0.16.2/xarray/tutorial.py</span>·in·<span·class="ansi-cyan-fg">open_dataset</span><span·class="ansi-blue-fg">(name,·cache,·cache_dir,·github_url,·branch,·**kws)</span> |
556 | <span·class="ansi-green-intense-fg·ansi-bold">·····76</span>·········<span·class="ansi-red-fg">#·May·want·to·add·an·option·to·remove·it.</span> | 556 | <span·class="ansi-green-intense-fg·ansi-bold">·····76</span>·········<span·class="ansi-red-fg">#·May·want·to·add·an·option·to·remove·it.</span> |
557 | <span·class="ansi-green-intense-fg·ansi-bold">·····77</span>·········<span·class="ansi-green-fg">if</span>·<span·class="ansi-green-fg">not</span>·_os<span·class="ansi-blue-fg">.</span>path<span·class="ansi-blue-fg">.</span>isdir<span·class="ansi-blue-fg">(</span>longdir<span·class="ansi-blue-fg">)</span><span·class="ansi-blue-fg">:</span> | 557 | <span·class="ansi-green-intense-fg·ansi-bold">·····77</span>·········<span·class="ansi-green-fg">if</span>·<span·class="ansi-green-fg">not</span>·_os<span·class="ansi-blue-fg">.</span>path<span·class="ansi-blue-fg">.</span>isdir<span·class="ansi-blue-fg">(</span>longdir<span·class="ansi-blue-fg">)</span><span·class="ansi-blue-fg">:</span> |
558 | <span·class="ansi-green-fg">--->·78</span><span·class="ansi-red-fg">·············</span>_os<span·class="ansi-blue-fg">.</span>mkdir<span·class="ansi-blue-fg">(</span>longdir<span·class="ansi-blue-fg">)</span> | 558 | <span·class="ansi-green-fg">--->·78</span><span·class="ansi-red-fg">·············</span>_os<span·class="ansi-blue-fg">.</span>mkdir<span·class="ansi-blue-fg">(</span>longdir<span·class="ansi-blue-fg">)</span> |
559 | <span·class="ansi-green-intense-fg·ansi-bold">·····79</span> | 559 | <span·class="ansi-green-intense-fg·ansi-bold">·····79</span> |
560 | <span·class="ansi-green-intense-fg·ansi-bold">·····80</span>·········url·<span·class="ansi-blue-fg">=</span>·<span·class="ansi-blue-fg">"/"</span><span·class="ansi-blue-fg">.</span>join<span·class="ansi-blue-fg">(</span><span·class="ansi-blue-fg">(</span>github_url<span·class="ansi-blue-fg">,</span>·<span·class="ansi-blue-fg">"raw"</span><span·class="ansi-blue-fg">,</span>·branch<span·class="ansi-blue-fg">,</span>·fullname<span·class="ansi-blue-fg">)</span><span·class="ansi-blue-fg">)</span> | 560 | <span·class="ansi-green-intense-fg·ansi-bold">·····80</span>·········url·<span·class="ansi-blue-fg">=</span>·<span·class="ansi-blue-fg">"/"</span><span·class="ansi-blue-fg">.</span>join<span·class="ansi-blue-fg">(</span><span·class="ansi-blue-fg">(</span>github_url<span·class="ansi-blue-fg">,</span>·<span·class="ansi-blue-fg">"raw"</span><span·class="ansi-blue-fg">,</span>·branch<span·class="ansi-blue-fg">,</span>·fullname<span·class="ansi-blue-fg">)</span><span·class="ansi-blue-fg">)</span> |
561 | <span·class="ansi-red-fg">FileNotFoundError</span>:·[Errno·2]·No·such·file·or·directory:·'/nonexistent/ | 561 | <span·class="ansi-red-fg">FileNotFoundError</span>:·[Errno·2]·No·such·file·or·directory:·'/nonexistent/second-build/.xarray_tutorial_data' |
562 | </pre></div></div> | 562 | </pre></div></div> |
563 | </div> | 563 | </div> |
564 | <p>The·function·we·will·apply·is·<code·class="docutils·literal·notranslate"><span·class="pre">np.interp</span></code>·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.</p> | 564 | <p>The·function·we·will·apply·is·<code·class="docutils·literal·notranslate"><span·class="pre">np.interp</span></code>·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.</p> |
565 | <div·class="nbinput·docutils·container"> | 565 | <div·class="nbinput·docutils·container"> |
566 | <div·class="prompt·highlight-none·notranslate"><div·class="highlight"><pre><span></span>[2]: | 566 | <div·class="prompt·highlight-none·notranslate"><div·class="highlight"><pre><span></span>[2]: |
567 | </pre></div> | 567 | </pre></div> |
568 | </div> | 568 | </div> |
Offset 116, 15 lines modified | Offset 116, 15 lines modified | ||
116 | open_dataset(name,·cache,·cache_dir,·github_url,·branch,·**kws) | 116 | open_dataset(name,·cache,·cache_dir,·github_url,·branch,·**kws) |
117 | ·····76·········#·May·want·to·add·an·option·to·remove·it. | 117 | ·····76·········#·May·want·to·add·an·option·to·remove·it. |
118 | ·····77·········if·not·_os.path.isdir(longdir): | 118 | ·····77·········if·not·_os.path.isdir(longdir): |
119 | --->·78·············_os.mkdir(longdir) | 119 | --->·78·············_os.mkdir(longdir) |
120 | ·····79 | 120 | ·····79 |
121 | ·····80·········url·=·"/".join((github_url,·"raw",·branch,·fullname)) | 121 | ·····80·········url·=·"/".join((github_url,·"raw",·branch,·fullname)) |
122 | FileNotFoundError:·[Errno·2]·No·such·file·or·directory:·'/nonexistent/ | 122 | FileNotFoundError:·[Errno·2]·No·such·file·or·directory:·'/nonexistent/second- |
123 | build/.xarray_tutorial_data' | 123 | build/.xarray_tutorial_data' |
124 | The·function·we·will·apply·is·np.interp·which·expects·1D·numpy·arrays.·This | 124 | The·function·we·will·apply·is·np.interp·which·expects·1D·numpy·arrays.·This |
125 | functionality·is·already·implemented·in·xarray·so·we·use·that·capability·to | 125 | functionality·is·already·implemented·in·xarray·so·we·use·that·capability·to |
126 | make·sure·we·are·not·making·mistakes. | 126 | make·sure·we·are·not·making·mistakes. |
127 | [2]: | 127 | [2]: |
128 | newlat·=·np.linspace(15,·75,·100) | 128 | newlat·=·np.linspace(15,·75,·100) |
129 | air.interp(lat=newlat) | 129 | air.interp(lat=newlat) |
Offset 39, 23 lines modified | Offset 39, 23 lines modified | ||
39 | ····················"end_time":·"2020-01-15T14:45:51.659160Z", | 39 | ····················"end_time":·"2020-01-15T14:45:51.659160Z", |
40 | ····················"start_time":·"2020-01-15T14:45:50.528742Z" | 40 | ····················"start_time":·"2020-01-15T14:45:50.528742Z" |
41 | ················} | 41 | ················} |
42 | ············}, | 42 | ············}, |
43 | ············"outputs":·[ | 43 | ············"outputs":·[ |
44 | ················{ | 44 | ················{ |
45 | ····················"ename":·"FileNotFoundError", | 45 | ····················"ename":·"FileNotFoundError", |
46 | ····················"evalue":·"[Errno·2]·No·such·file·or·directory:·'/nonexistent/ | 46 | ····················"evalue":·"[Errno·2]·No·such·file·or·directory:·'/nonexistent/second-build/.xarray_tutorial_data'", |
47 | ····················"output_type":·"error", | 47 | ····················"output_type":·"error", |
48 | ····················"traceback":·[ | 48 | ····················"traceback":·[ |
49 | ························"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", | 49 | ························"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", |
50 | ························"\u001b[0;31mFileNotFoundError\u001b[0m·························Traceback·(most·recent·call·last)", | 50 | ························"\u001b[0;31mFileNotFoundError\u001b[0m·························Traceback·(most·recent·call·last)", |
51 | ························"\u001b[0;32m<ipython-input-1-5e8aec42a87b>\u001b[0m·in·\u001b[0;36m<module>\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", | 51 | ························"\u001b[0;32m<ipython-input-1-5e8aec42a87b>\u001b[0m·in·\u001b[0;36m<module>\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", |
52 | ························"\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", | 52 | ························"\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", |
53 | ························"\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", | 53 | ························"\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", |
54 | ························"\u001b[0;31mFileNotFoundError\u001b[0m:·[Errno·2]·No·such·file·or·directory:·'/nonexistent/ | 54 | ························"\u001b[0;31mFileNotFoundError\u001b[0m:·[Errno·2]·No·such·file·or·directory:·'/nonexistent/second-build/.xarray_tutorial_data'" |
55 | ····················] | 55 | ····················] |
56 | ················} | 56 | ················} |
57 | ············], | 57 | ············], |
58 | ············"source":·[ | 58 | ············"source":·[ |
59 | ················"import·xarray·as·xr\n", | 59 | ················"import·xarray·as·xr\n", |
60 | ················"import·numpy·as·np\n", | 60 | ················"import·numpy·as·np\n", |
61 | ················"\n", | 61 | ················"\n", |
Offset 555, 15 lines modified | Offset 555, 15 lines modified | ||
555 | <span·class="ansi-green-fg">/build/reproducible-path/python-xarray-0.16.2/xarray/tutorial.py</span>·in·<span·class="ansi-cyan-fg">open_dataset</span><span·class="ansi-blue-fg">(name,·cache,·cache_dir,·github_url,·branch,·**kws)</span> | 555 | <span·class="ansi-green-fg">/build/reproducible-path/python-xarray-0.16.2/xarray/tutorial.py</span>·in·<span·class="ansi-cyan-fg">open_dataset</span><span·class="ansi-blue-fg">(name,·cache,·cache_dir,·github_url,·branch,·**kws)</span> |
556 | <span·class="ansi-green-intense-fg·ansi-bold">·····76</span>·········<span·class="ansi-red-fg">#·May·want·to·add·an·option·to·remove·it.</span> | 556 | <span·class="ansi-green-intense-fg·ansi-bold">·····76</span>·········<span·class="ansi-red-fg">#·May·want·to·add·an·option·to·remove·it.</span> |
557 | <span·class="ansi-green-intense-fg·ansi-bold">·····77</span>·········<span·class="ansi-green-fg">if</span>·<span·class="ansi-green-fg">not</span>·_os<span·class="ansi-blue-fg">.</span>path<span·class="ansi-blue-fg">.</span>isdir<span·class="ansi-blue-fg">(</span>longdir<span·class="ansi-blue-fg">)</span><span·class="ansi-blue-fg">:</span> | 557 | <span·class="ansi-green-intense-fg·ansi-bold">·····77</span>·········<span·class="ansi-green-fg">if</span>·<span·class="ansi-green-fg">not</span>·_os<span·class="ansi-blue-fg">.</span>path<span·class="ansi-blue-fg">.</span>isdir<span·class="ansi-blue-fg">(</span>longdir<span·class="ansi-blue-fg">)</span><span·class="ansi-blue-fg">:</span> |
558 | <span·class="ansi-green-fg">--->·78</span><span·class="ansi-red-fg">·············</span>_os<span·class="ansi-blue-fg">.</span>mkdir<span·class="ansi-blue-fg">(</span>longdir<span·class="ansi-blue-fg">)</span> | 558 | <span·class="ansi-green-fg">--->·78</span><span·class="ansi-red-fg">·············</span>_os<span·class="ansi-blue-fg">.</span>mkdir<span·class="ansi-blue-fg">(</span>longdir<span·class="ansi-blue-fg">)</span> |
559 | <span·class="ansi-green-intense-fg·ansi-bold">·····79</span> | 559 | <span·class="ansi-green-intense-fg·ansi-bold">·····79</span> |
560 | <span·class="ansi-green-intense-fg·ansi-bold">·····80</span>·········url·<span·class="ansi-blue-fg">=</span>·<span·class="ansi-blue-fg">"/"</span><span·class="ansi-blue-fg">.</span>join<span·class="ansi-blue-fg">(</span><span·class="ansi-blue-fg">(</span>github_url<span·class="ansi-blue-fg">,</span>·<span·class="ansi-blue-fg">"raw"</span><span·class="ansi-blue-fg">,</span>·branch<span·class="ansi-blue-fg">,</span>·fullname<span·class="ansi-blue-fg">)</span><span·class="ansi-blue-fg">)</span> | 560 | <span·class="ansi-green-intense-fg·ansi-bold">·····80</span>·········url·<span·class="ansi-blue-fg">=</span>·<span·class="ansi-blue-fg">"/"</span><span·class="ansi-blue-fg">.</span>join<span·class="ansi-blue-fg">(</span><span·class="ansi-blue-fg">(</span>github_url<span·class="ansi-blue-fg">,</span>·<span·class="ansi-blue-fg">"raw"</span><span·class="ansi-blue-fg">,</span>·branch<span·class="ansi-blue-fg">,</span>·fullname<span·class="ansi-blue-fg">)</span><span·class="ansi-blue-fg">)</span> |
561 | <span·class="ansi-red-fg">FileNotFoundError</span>:·[Errno·2]·No·such·file·or·directory:·'/nonexistent/ | 561 | <span·class="ansi-red-fg">FileNotFoundError</span>:·[Errno·2]·No·such·file·or·directory:·'/nonexistent/second-build/.xarray_tutorial_data' |
562 | </pre></div></div> | 562 | </pre></div></div> |
563 | </div> | 563 | </div> |
564 | <p>Plot·the·first·timestep:</p> | 564 | <p>Plot·the·first·timestep:</p> |
565 | <div·class="nbinput·docutils·container"> | 565 | <div·class="nbinput·docutils·container"> |
566 | <div·class="prompt·highlight-none·notranslate"><div·class="highlight"><pre><span></span>[3]: | 566 | <div·class="prompt·highlight-none·notranslate"><div·class="highlight"><pre><span></span>[3]: |
567 | </pre></div> | 567 | </pre></div> |
568 | </div> | 568 | </div> |
Offset 113, 15 lines modified | Offset 113, 15 lines modified | ||
113 | open_dataset(name,·cache,·cache_dir,·github_url,·branch,·**kws) | 113 | open_dataset(name,·cache,·cache_dir,·github_url,·branch,·**kws) |
114 | ·····76·········#·May·want·to·add·an·option·to·remove·it. | 114 | ·····76·········#·May·want·to·add·an·option·to·remove·it. |
115 | ·····77·········if·not·_os.path.isdir(longdir): | 115 | ·····77·········if·not·_os.path.isdir(longdir): |
116 | --->·78·············_os.mkdir(longdir) | 116 | --->·78·············_os.mkdir(longdir) |
117 | ·····79 | 117 | ·····79 |
118 | ·····80·········url·=·"/".join((github_url,·"raw",·branch,·fullname)) | 118 | ·····80·········url·=·"/".join((github_url,·"raw",·branch,·fullname)) |
119 | FileNotFoundError:·[Errno·2]·No·such·file·or·directory:·'/nonexistent/ | 119 | FileNotFoundError:·[Errno·2]·No·such·file·or·directory:·'/nonexistent/second- |
120 | build/.xarray_tutorial_data' | 120 | build/.xarray_tutorial_data' |
121 | Plot·the·first·timestep: | 121 | Plot·the·first·timestep: |
122 | [3]: | 122 | [3]: |
123 | projection·=·ccrs.LambertConformal(central_longitude=-95,·central_latitude=45) | 123 | projection·=·ccrs.LambertConformal(central_longitude=-95,·central_latitude=45) |
124 | f,·ax·=·plt.subplots(subplot_kw=dict(projection=projection)) | 124 | f,·ax·=·plt.subplots(subplot_kw=dict(projection=projection)) |
Offset 60, 23 lines modified | Offset 60, 23 lines modified | ||
60 | ····················"end_time":·"2020-03-17T14:43:57.831734Z", | 60 | ····················"end_time":·"2020-03-17T14:43:57.831734Z", |
61 | ····················"start_time":·"2020-03-17T14:43:57.651845Z" | 61 | ····················"start_time":·"2020-03-17T14:43:57.651845Z" |
62 | ················} | 62 | ················} |
63 | ············}, | 63 | ············}, |
64 | ············"outputs":·[ | 64 | ············"outputs":·[ |
65 | ················{ | 65 | ················{ |
66 | ····················"ename":·"FileNotFoundError", | 66 | ····················"ename":·"FileNotFoundError", |
67 | ····················"evalue":·"[Errno·2]·No·such·file·or·directory:·'/nonexistent/ | 67 | ····················"evalue":·"[Errno·2]·No·such·file·or·directory:·'/nonexistent/second-build/.xarray_tutorial_data'", |
68 | ····················"output_type":·"error", | 68 | ····················"output_type":·"error", |
69 | ····················"traceback":·[ | 69 | ····················"traceback":·[ |
70 | ························"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", | 70 | ························"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", |
71 | ························"\u001b[0;31mFileNotFoundError\u001b[0m·························Traceback·(most·recent·call·last)", | 71 | ························"\u001b[0;31mFileNotFoundError\u001b[0m·························Traceback·(most·recent·call·last)", |
72 | ························"\u001b[0;32m<ipython-input-2-91cf2eecbfdd>\u001b[0m·in·\u001b[0;36m<module>\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", | 72 | ························"\u001b[0;32m<ipython-input-2-91cf2eecbfdd>\u001b[0m·in·\u001b[0;36m<module>\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", |
73 | ························"\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", | 73 | ························"\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", |
74 | ························"\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", | 74 | ························"\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", |
75 | ························"\u001b[0;31mFileNotFoundError\u001b[0m:·[Errno·2]·No·such·file·or·directory:·'/nonexistent/ | 75 | ························"\u001b[0;31mFileNotFoundError\u001b[0m:·[Errno·2]·No·such·file·or·directory:·'/nonexistent/second-build/.xarray_tutorial_data'" |
76 | ····················] | 76 | ····················] |
77 | ················} | 77 | ················} |
78 | ············], | 78 | ············], |
79 | ············"source":·[ | 79 | ············"source":·[ |
80 | ················"ds·=·xr.tutorial.load_dataset(\"air_temperature\")\n", | 80 | ················"ds·=·xr.tutorial.load_dataset(\"air_temperature\")\n", |
81 | ················"\n", | 81 | ················"\n", |
82 | ················"#·to·celsius\n", | 82 | ················"#·to·celsius\n", |
Offset 528, 15 lines modified | Offset 528, 15 lines modified | ||
528 | <span·class="ansi-green-fg">/build/reproducible-path/python-xarray-0.16.2/xarray/tutorial.py</span>·in·<span·class="ansi-cyan-fg">open_dataset</span><span·class="ansi-blue-fg">(name,·cache,·cache_dir,·github_url,·branch,·**kws)</span> | 528 | <span·class="ansi-green-fg">/build/reproducible-path/python-xarray-0.16.2/xarray/tutorial.py</span>·in·<span·class="ansi-cyan-fg">open_dataset</span><span·class="ansi-blue-fg">(name,·cache,·cache_dir,·github_url,·branch,·**kws)</span> |
529 | <span·class="ansi-green-intense-fg·ansi-bold">·····76</span>·········<span·class="ansi-red-fg">#·May·want·to·add·an·option·to·remove·it.</span> | 529 | <span·class="ansi-green-intense-fg·ansi-bold">·····76</span>·········<span·class="ansi-red-fg">#·May·want·to·add·an·option·to·remove·it.</span> |
530 | <span·class="ansi-green-intense-fg·ansi-bold">·····77</span>·········<span·class="ansi-green-fg">if</span>·<span·class="ansi-green-fg">not</span>·_os<span·class="ansi-blue-fg">.</span>path<span·class="ansi-blue-fg">.</span>isdir<span·class="ansi-blue-fg">(</span>longdir<span·class="ansi-blue-fg">)</span><span·class="ansi-blue-fg">:</span> | 530 | <span·class="ansi-green-intense-fg·ansi-bold">·····77</span>·········<span·class="ansi-green-fg">if</span>·<span·class="ansi-green-fg">not</span>·_os<span·class="ansi-blue-fg">.</span>path<span·class="ansi-blue-fg">.</span>isdir<span·class="ansi-blue-fg">(</span>longdir<span·class="ansi-blue-fg">)</span><span·class="ansi-blue-fg">:</span> |
531 | <span·class="ansi-green-fg">--->·78</span><span·class="ansi-red-fg">·············</span>_os<span·class="ansi-blue-fg">.</span>mkdir<span·class="ansi-blue-fg">(</span>longdir<span·class="ansi-blue-fg">)</span> | 531 | <span·class="ansi-green-fg">--->·78</span><span·class="ansi-red-fg">·············</span>_os<span·class="ansi-blue-fg">.</span>mkdir<span·class="ansi-blue-fg">(</span>longdir<span·class="ansi-blue-fg">)</span> |
532 | <span·class="ansi-green-intense-fg·ansi-bold">·····79</span> | 532 | <span·class="ansi-green-intense-fg·ansi-bold">·····79</span> |
533 | <span·class="ansi-green-intense-fg·ansi-bold">·····80</span>·········url·<span·class="ansi-blue-fg">=</span>·<span·class="ansi-blue-fg">"/"</span><span·class="ansi-blue-fg">.</span>join<span·class="ansi-blue-fg">(</span><span·class="ansi-blue-fg">(</span>github_url<span·class="ansi-blue-fg">,</span>·<span·class="ansi-blue-fg">"raw"</span><span·class="ansi-blue-fg">,</span>·branch<span·class="ansi-blue-fg">,</span>·fullname<span·class="ansi-blue-fg">)</span><span·class="ansi-blue-fg">)</span> | 533 | <span·class="ansi-green-intense-fg·ansi-bold">·····80</span>·········url·<span·class="ansi-blue-fg">=</span>·<span·class="ansi-blue-fg">"/"</span><span·class="ansi-blue-fg">.</span>join<span·class="ansi-blue-fg">(</span><span·class="ansi-blue-fg">(</span>github_url<span·class="ansi-blue-fg">,</span>·<span·class="ansi-blue-fg">"raw"</span><span·class="ansi-blue-fg">,</span>·branch<span·class="ansi-blue-fg">,</span>·fullname<span·class="ansi-blue-fg">)</span><span·class="ansi-blue-fg">)</span> |
534 | <span·class="ansi-red-fg">FileNotFoundError</span>:·[Errno·2]·No·such·file·or·directory:·'/nonexistent/ | 534 | <span·class="ansi-red-fg">FileNotFoundError</span>:·[Errno·2]·No·such·file·or·directory:·'/nonexistent/second-build/.xarray_tutorial_data' |
535 | </pre></div></div> | 535 | </pre></div></div> |
536 | </div> | 536 | </div> |
537 | </div> | 537 | </div> |
538 | <div·class="section"·id="Now-for-the-heavy-lifting:"> | 538 | <div·class="section"·id="Now-for-the-heavy-lifting:"> |
539 | <h2>Now·for·the·heavy·lifting:<a·class="headerlink"·href="#Now-for-the-heavy-lifting:"·title="Permalink·to·this·headline">¶</a></h2> | 539 | <h2>Now·for·the·heavy·lifting:<a·class="headerlink"·href="#Now-for-the-heavy-lifting:"·title="Permalink·to·this·headline">¶</a></h2> |
540 | <p>We·first·have·to·come·up·with·the·weights,·-·calculate·the·month·lengths·for·each·monthly·data·record·-·calculate·weights·using·<code·class="docutils·literal·notranslate"><span·class="pre">groupby('time.season')</span></code></p> | 540 | <p>We·first·have·to·come·up·with·the·weights,·-·calculate·the·month·lengths·for·each·monthly·data·record·-·calculate·weights·using·<code·class="docutils·literal·notranslate"><span·class="pre">groupby('time.season')</span></code></p> |
541 | <p>Finally,·we·just·need·to·multiply·our·weights·by·the·<code·class="docutils·literal·notranslate"><span·class="pre">Dataset</span></code>·and·sum·allong·the·time·dimension.·Creating·a·<code·class="docutils·literal·notranslate"><span·class="pre">DataArray</span></code>·for·the·month·length·is·as·easy·as·using·the·<code·class="docutils·literal·notranslate"><span·class="pre">days_in_month</span></code>·accessor·on·the·time·coordinate.·The·calendar·type,·in·this·case·<code·class="docutils·literal·notranslate"><span·class="pre">'noleap'</span></code>,·is·automatically·considered·in·this·operation.</p> | 541 | <p>Finally,·we·just·need·to·multiply·our·weights·by·the·<code·class="docutils·literal·notranslate"><span·class="pre">Dataset</span></code>·and·sum·allong·the·time·dimension.·Creating·a·<code·class="docutils·literal·notranslate"><span·class="pre">DataArray</span></code>·for·the·month·length·is·as·easy·as·using·the·<code·class="docutils·literal·notranslate"><span·class="pre">days_in_month</span></code>·accessor·on·the·time·coordinate.·The·calendar·type,·in·this·case·<code·class="docutils·literal·notranslate"><span·class="pre">'noleap'</span></code>,·is·automatically·considered·in·this·operation.</p> |
Offset 85, 15 lines modified | Offset 85, 15 lines modified | ||
85 | open_dataset(name,·cache,·cache_dir,·github_url,·branch,·**kws) | 85 | open_dataset(name,·cache,·cache_dir,·github_url,·branch,·**kws) |
86 | ·····76·········#·May·want·to·add·an·option·to·remove·it. | 86 | ·····76·········#·May·want·to·add·an·option·to·remove·it. |
87 | ·····77·········if·not·_os.path.isdir(longdir): | 87 | ·····77·········if·not·_os.path.isdir(longdir): |
88 | --->·78·············_os.mkdir(longdir) | 88 | --->·78·············_os.mkdir(longdir) |
89 | ·····79 | 89 | ·····79 |
90 | ·····80·········url·=·"/".join((github_url,·"raw",·branch,·fullname)) | 90 | ·····80·········url·=·"/".join((github_url,·"raw",·branch,·fullname)) |
91 | FileNotFoundError:·[Errno·2]·No·such·file·or·directory:·'/nonexistent/ | 91 | FileNotFoundError:·[Errno·2]·No·such·file·or·directory:·'/nonexistent/second- |
92 | build/.xarray_tutorial_data' | 92 | build/.xarray_tutorial_data' |
93 | *****·Now·for·the·heavy·lifting:¶·***** | 93 | *****·Now·for·the·heavy·lifting:¶·***** |
94 | We·first·have·to·come·up·with·the·weights,·-·calculate·the·month·lengths·for | 94 | We·first·have·to·come·up·with·the·weights,·-·calculate·the·month·lengths·for |
95 | each·monthly·data·record·-·calculate·weights·using·groupby('time.season') | 95 | each·monthly·data·record·-·calculate·weights·using·groupby('time.season') |
96 | Finally,·we·just·need·to·multiply·our·weights·by·the·Dataset·and·sum·allong·the | 96 | Finally,·we·just·need·to·multiply·our·weights·by·the·Dataset·and·sum·allong·the |
97 | time·dimension.·Creating·a·DataArray·for·the·month·length·is·as·easy·as·using | 97 | time·dimension.·Creating·a·DataArray·for·the·month·length·is·as·easy·as·using |
98 | the·days_in_month·accessor·on·the·time·coordinate.·The·calendar·type,·in·this | 98 | the·days_in_month·accessor·on·the·time·coordinate.·The·calendar·type,·in·this |
Offset 47, 22 lines modified | Offset 47, 22 lines modified | ||
47 | ····················"end_time":·"2018-11-28T20:51:36.072316Z", | 47 | ····················"end_time":·"2018-11-28T20:51:36.072316Z", |
48 | ····················"start_time":·"2018-11-28T20:51:36.016594Z" | 48 | ····················"start_time":·"2018-11-28T20:51:36.016594Z" |
49 | ················} | 49 | ················} |
50 | ············}, | 50 | ············}, |
51 | ············"outputs":·[ | 51 | ············"outputs":·[ |
52 | ················{ | 52 | ················{ |
53 | ····················"ename":·"FileNotFoundError", | 53 | ····················"ename":·"FileNotFoundError", |
54 | ····················"evalue":·"[Errno·2]·No·such·file·or·directory:·'/nonexistent/ | 54 | ····················"evalue":·"[Errno·2]·No·such·file·or·directory:·'/nonexistent/second-build/.xarray_tutorial_data'", |
55 | ····················"output_type":·"error", | 55 | ····················"output_type":·"error", |
56 | ····················"traceback":·[ | 56 | ····················"traceback":·[ |
57 | ························"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", | 57 | ························"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", |
58 | ························"\u001b[0;31mFileNotFoundError\u001b[0m·························Traceback·(most·recent·call·last)", | 58 | ························"\u001b[0;31mFileNotFoundError\u001b[0m·························Traceback·(most·recent·call·last)", |
59 | ························"\u001b[0;32m<ipython-input-2-0eb806e38f7f>\u001b[0m·in·\u001b[0;36m<module>\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", | 59 | ························"\u001b[0;32m<ipython-input-2-0eb806e38f7f>\u001b[0m·in·\u001b[0;36m<module>\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", |
60 | ························"\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", | 60 | ························"\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", |
61 | ························"\u001b[0;31mFileNotFoundError\u001b[0m:·[Errno·2]·No·such·file·or·directory:·'/nonexistent/ | 61 | ························"\u001b[0;31mFileNotFoundError\u001b[0m:·[Errno·2]·No·such·file·or·directory:·'/nonexistent/second-build/.xarray_tutorial_data'" |
62 | ····················] | 62 | ····················] |
63 | ················} | 63 | ················} |
64 | ············], | 64 | ············], |
65 | ············"source":·[ | 65 | ············"source":·[ |
66 | ················"ds·=·xr.tutorial.open_dataset('rasm').load()\n", | 66 | ················"ds·=·xr.tutorial.open_dataset('rasm').load()\n", |
67 | ················"ds" | 67 | ················"ds" |
68 | ············] | 68 | ············] |
Offset 527, 15 lines modified | Offset 527, 15 lines modified | ||
527 | <span·class="ansi-green-fg">/build/reproducible-path/python-xarray-0.16.2/xarray/tutorial.py</span>·in·<span·class="ansi-cyan-fg">open_dataset</span><span·class="ansi-blue-fg">(name,·cache,·cache_dir,·github_url,·branch,·**kws)</span> | 527 | <span·class="ansi-green-fg">/build/reproducible-path/python-xarray-0.16.2/xarray/tutorial.py</span>·in·<span·class="ansi-cyan-fg">open_dataset</span><span·class="ansi-blue-fg">(name,·cache,·cache_dir,·github_url,·branch,·**kws)</span> |
528 | <span·class="ansi-green-intense-fg·ansi-bold">·····76</span>·········<span·class="ansi-red-fg">#·May·want·to·add·an·option·to·remove·it.</span> | 528 | <span·class="ansi-green-intense-fg·ansi-bold">·····76</span>·········<span·class="ansi-red-fg">#·May·want·to·add·an·option·to·remove·it.</span> |
529 | <span·class="ansi-green-intense-fg·ansi-bold">·····77</span>·········<span·class="ansi-green-fg">if</span>·<span·class="ansi-green-fg">not</span>·_os<span·class="ansi-blue-fg">.</span>path<span·class="ansi-blue-fg">.</span>isdir<span·class="ansi-blue-fg">(</span>longdir<span·class="ansi-blue-fg">)</span><span·class="ansi-blue-fg">:</span> | 529 | <span·class="ansi-green-intense-fg·ansi-bold">·····77</span>·········<span·class="ansi-green-fg">if</span>·<span·class="ansi-green-fg">not</span>·_os<span·class="ansi-blue-fg">.</span>path<span·class="ansi-blue-fg">.</span>isdir<span·class="ansi-blue-fg">(</span>longdir<span·class="ansi-blue-fg">)</span><span·class="ansi-blue-fg">:</span> |
530 | <span·class="ansi-green-fg">--->·78</span><span·class="ansi-red-fg">·············</span>_os<span·class="ansi-blue-fg">.</span>mkdir<span·class="ansi-blue-fg">(</span>longdir<span·class="ansi-blue-fg">)</span> | 530 | <span·class="ansi-green-fg">--->·78</span><span·class="ansi-red-fg">·············</span>_os<span·class="ansi-blue-fg">.</span>mkdir<span·class="ansi-blue-fg">(</span>longdir<span·class="ansi-blue-fg">)</span> |
531 | <span·class="ansi-green-intense-fg·ansi-bold">·····79</span> | 531 | <span·class="ansi-green-intense-fg·ansi-bold">·····79</span> |
532 | <span·class="ansi-green-intense-fg·ansi-bold">·····80</span>·········url·<span·class="ansi-blue-fg">=</span>·<span·class="ansi-blue-fg">"/"</span><span·class="ansi-blue-fg">.</span>join<span·class="ansi-blue-fg">(</span><span·class="ansi-blue-fg">(</span>github_url<span·class="ansi-blue-fg">,</span>·<span·class="ansi-blue-fg">"raw"</span><span·class="ansi-blue-fg">,</span>·branch<span·class="ansi-blue-fg">,</span>·fullname<span·class="ansi-blue-fg">)</span><span·class="ansi-blue-fg">)</span> | 532 | <span·class="ansi-green-intense-fg·ansi-bold">·····80</span>·········url·<span·class="ansi-blue-fg">=</span>·<span·class="ansi-blue-fg">"/"</span><span·class="ansi-blue-fg">.</span>join<span·class="ansi-blue-fg">(</span><span·class="ansi-blue-fg">(</span>github_url<span·class="ansi-blue-fg">,</span>·<span·class="ansi-blue-fg">"raw"</span><span·class="ansi-blue-fg">,</span>·branch<span·class="ansi-blue-fg">,</span>·fullname<span·class="ansi-blue-fg">)</span><span·class="ansi-blue-fg">)</span> |
533 | <span·class="ansi-red-fg">FileNotFoundError</span>:·[Errno·2]·No·such·file·or·directory:·'/nonexistent/ | 533 | <span·class="ansi-red-fg">FileNotFoundError</span>:·[Errno·2]·No·such·file·or·directory:·'/nonexistent/second-build/.xarray_tutorial_data' |
534 | </pre></div></div> | 534 | </pre></div></div> |
535 | </div> | 535 | </div> |
536 | <p>In·this·example,·the·<em>logical·coordinates</em>·are·<code·class="docutils·literal·notranslate"><span·class="pre">x</span></code>·and·<code·class="docutils·literal·notranslate"><span·class="pre">y</span></code>,·while·the·<em>physical·coordinates</em>·are·<code·class="docutils·literal·notranslate"><span·class="pre">xc</span></code>·and·<code·class="docutils·literal·notranslate"><span·class="pre">yc</span></code>,·which·represent·the·latitudes·and·longitude·of·the·data.</p> | 536 | <p>In·this·example,·the·<em>logical·coordinates</em>·are·<code·class="docutils·literal·notranslate"><span·class="pre">x</span></code>·and·<code·class="docutils·literal·notranslate"><span·class="pre">y</span></code>,·while·the·<em>physical·coordinates</em>·are·<code·class="docutils·literal·notranslate"><span·class="pre">xc</span></code>·and·<code·class="docutils·literal·notranslate"><span·class="pre">yc</span></code>,·which·represent·the·latitudes·and·longitude·of·the·data.</p> |
537 | <div·class="nbinput·docutils·container"> | 537 | <div·class="nbinput·docutils·container"> |
538 | <div·class="prompt·highlight-none·notranslate"><div·class="highlight"><pre><span></span>[3]: | 538 | <div·class="prompt·highlight-none·notranslate"><div·class="highlight"><pre><span></span>[3]: |
539 | </pre></div> | 539 | </pre></div> |
540 | </div> | 540 | </div> |
Offset 83, 15 lines modified | Offset 83, 15 lines modified | ||
83 | open_dataset(name,·cache,·cache_dir,·github_url,·branch,·**kws) | 83 | open_dataset(name,·cache,·cache_dir,·github_url,·branch,·**kws) |
84 | ·····76·········#·May·want·to·add·an·option·to·remove·it. | 84 | ·····76·········#·May·want·to·add·an·option·to·remove·it. |
85 | ·····77·········if·not·_os.path.isdir(longdir): | 85 | ·····77·········if·not·_os.path.isdir(longdir): |
86 | --->·78·············_os.mkdir(longdir) | 86 | --->·78·············_os.mkdir(longdir) |
87 | ·····79 | 87 | ·····79 |
88 | ·····80·········url·=·"/".join((github_url,·"raw",·branch,·fullname)) | 88 | ·····80·········url·=·"/".join((github_url,·"raw",·branch,·fullname)) |
89 | FileNotFoundError:·[Errno·2]·No·such·file·or·directory:·'/nonexistent/ | 89 | FileNotFoundError:·[Errno·2]·No·such·file·or·directory:·'/nonexistent/second- |
90 | build/.xarray_tutorial_data' | 90 | build/.xarray_tutorial_data' |
91 | In·this·example,·the·logical·coordinates·are·x·and·y,·while·the·physical | 91 | In·this·example,·the·logical·coordinates·are·x·and·y,·while·the·physical |
92 | coordinates·are·xc·and·yc,·which·represent·the·latitudes·and·longitude·of·the | 92 | coordinates·are·xc·and·yc,·which·represent·the·latitudes·and·longitude·of·the |
93 | data. | 93 | data. |
94 | [3]: | 94 | [3]: |
95 | print(ds.xc.attrs) | 95 | print(ds.xc.attrs) |
96 | print(ds.yc.attrs) | 96 | print(ds.yc.attrs) |
Offset 45, 22 lines modified | Offset 45, 22 lines modified | ||
45 | ····················"end_time":·"2018-11-28T20:50:13.629720Z", | 45 | ····················"end_time":·"2018-11-28T20:50:13.629720Z", |
46 | ····················"start_time":·"2018-11-28T20:50:13.484542Z" | 46 | ····················"start_time":·"2018-11-28T20:50:13.484542Z" |
47 | ················} | 47 | ················} |
48 | ············}, | 48 | ············}, |
49 | ············"outputs":·[ | 49 | ············"outputs":·[ |
50 | ················{ | 50 | ················{ |
51 | ····················"ename":·"FileNotFoundError", | 51 | ····················"ename":·"FileNotFoundError", |
52 | ····················"evalue":·"[Errno·2]·No·such·file·or·directory:·'/nonexistent/ | 52 | ····················"evalue":·"[Errno·2]·No·such·file·or·directory:·'/nonexistent/second-build/.xarray_tutorial_data'", |
53 | ····················"output_type":·"error", | 53 | ····················"output_type":·"error", |
54 | ····················"traceback":·[ | 54 | ····················"traceback":·[ |
55 | ························"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", | 55 | ························"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", |
56 | ························"\u001b[0;31mFileNotFoundError\u001b[0m·························Traceback·(most·recent·call·last)", | 56 | ························"\u001b[0;31mFileNotFoundError\u001b[0m·························Traceback·(most·recent·call·last)", |
57 | ························"\u001b[0;32m<ipython-input-2-0eb806e38f7f>\u001b[0m·in·\u001b[0;36m<module>\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", | 57 | ························"\u001b[0;32m<ipython-input-2-0eb806e38f7f>\u001b[0m·in·\u001b[0;36m<module>\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", |
58 | ························"\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", | 58 | ························"\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", |
59 | ························"\u001b[0;31mFileNotFoundError\u001b[0m:·[Errno·2]·No·such·file·or·directory:·'/nonexistent/ | 59 | ························"\u001b[0;31mFileNotFoundError\u001b[0m:·[Errno·2]·No·such·file·or·directory:·'/nonexistent/second-build/.xarray_tutorial_data'" |
60 | ····················] | 60 | ····················] |
61 | ················} | 61 | ················} |
62 | ············], | 62 | ············], |
63 | ············"source":·[ | 63 | ············"source":·[ |
64 | ················"ds·=·xr.tutorial.open_dataset('rasm').load()\n", | 64 | ················"ds·=·xr.tutorial.open_dataset('rasm').load()\n", |
65 | ················"ds" | 65 | ················"ds" |
66 | ············] | 66 | ············] |
Offset 533, 15 lines modified | Offset 533, 15 lines modified | ||
533 | <span·class="ansi-green-fg">/build/reproducible-path/python-xarray-0.16.2/xarray/tutorial.py</span>·in·<span·class="ansi-cyan-fg">open_dataset</span><span·class="ansi-blue-fg">(name,·cache,·cache_dir,·github_url,·branch,·**kws)</span> | 533 | <span·class="ansi-green-fg">/build/reproducible-path/python-xarray-0.16.2/xarray/tutorial.py</span>·in·<span·class="ansi-cyan-fg">open_dataset</span><span·class="ansi-blue-fg">(name,·cache,·cache_dir,·github_url,·branch,·**kws)</span> |
534 | <span·class="ansi-green-intense-fg·ansi-bold">·····76</span>·········<span·class="ansi-red-fg">#·May·want·to·add·an·option·to·remove·it.</span> | 534 | <span·class="ansi-green-intense-fg·ansi-bold">·····76</span>·········<span·class="ansi-red-fg">#·May·want·to·add·an·option·to·remove·it.</span> |
535 | <span·class="ansi-green-intense-fg·ansi-bold">·····77</span>·········<span·class="ansi-green-fg">if</span>·<span·class="ansi-green-fg">not</span>·_os<span·class="ansi-blue-fg">.</span>path<span·class="ansi-blue-fg">.</span>isdir<span·class="ansi-blue-fg">(</span>longdir<span·class="ansi-blue-fg">)</span><span·class="ansi-blue-fg">:</span> | 535 | <span·class="ansi-green-intense-fg·ansi-bold">·····77</span>·········<span·class="ansi-green-fg">if</span>·<span·class="ansi-green-fg">not</span>·_os<span·class="ansi-blue-fg">.</span>path<span·class="ansi-blue-fg">.</span>isdir<span·class="ansi-blue-fg">(</span>longdir<span·class="ansi-blue-fg">)</span><span·class="ansi-blue-fg">:</span> |
536 | <span·class="ansi-green-fg">--->·78</span><span·class="ansi-red-fg">·············</span>_os<span·class="ansi-blue-fg">.</span>mkdir<span·class="ansi-blue-fg">(</span>longdir<span·class="ansi-blue-fg">)</span> | 536 | <span·class="ansi-green-fg">--->·78</span><span·class="ansi-red-fg">·············</span>_os<span·class="ansi-blue-fg">.</span>mkdir<span·class="ansi-blue-fg">(</span>longdir<span·class="ansi-blue-fg">)</span> |
537 | <span·class="ansi-green-intense-fg·ansi-bold">·····79</span> | 537 | <span·class="ansi-green-intense-fg·ansi-bold">·····79</span> |
538 | <span·class="ansi-green-intense-fg·ansi-bold">·····80</span>·········url·<span·class="ansi-blue-fg">=</span>·<span·class="ansi-blue-fg">"/"</span><span·class="ansi-blue-fg">.</span>join<span·class="ansi-blue-fg">(</span><span·class="ansi-blue-fg">(</span>github_url<span·class="ansi-blue-fg">,</span>·<span·class="ansi-blue-fg">"raw"</span><span·class="ansi-blue-fg">,</span>·branch<span·class="ansi-blue-fg">,</span>·fullname<span·class="ansi-blue-fg">)</span><span·class="ansi-blue-fg">)</span> | 538 | <span·class="ansi-green-intense-fg·ansi-bold">·····80</span>·········url·<span·class="ansi-blue-fg">=</span>·<span·class="ansi-blue-fg">"/"</span><span·class="ansi-blue-fg">.</span>join<span·class="ansi-blue-fg">(</span><span·class="ansi-blue-fg">(</span>github_url<span·class="ansi-blue-fg">,</span>·<span·class="ansi-blue-fg">"raw"</span><span·class="ansi-blue-fg">,</span>·branch<span·class="ansi-blue-fg">,</span>·fullname<span·class="ansi-blue-fg">)</span><span·class="ansi-blue-fg">)</span> |
539 | <span·class="ansi-red-fg">FileNotFoundError</span>:·[Errno·2]·No·such·file·or·directory:·'/nonexistent/ | 539 | <span·class="ansi-red-fg">FileNotFoundError</span>:·[Errno·2]·No·such·file·or·directory:·'/nonexistent/second-build/.xarray_tutorial_data' |
540 | </pre></div></div> | 540 | </pre></div></div> |
541 | </div> | 541 | </div> |
542 | <div·class="section"·id="Multiple-plots-and-map-projections"> | 542 | <div·class="section"·id="Multiple-plots-and-map-projections"> |
543 | <h2>Multiple·plots·and·map·projections<a·class="headerlink"·href="#Multiple-plots-and-map-projections"·title="Permalink·to·this·headline">¶</a></h2> | 543 | <h2>Multiple·plots·and·map·projections<a·class="headerlink"·href="#Multiple-plots-and-map-projections"·title="Permalink·to·this·headline">¶</a></h2> |
544 | <p>Control·the·map·projection·parameters·on·multiple·axes</p> | 544 | <p>Control·the·map·projection·parameters·on·multiple·axes</p> |
545 | <p>This·example·illustrates·how·to·plot·multiple·maps·and·control·their·extent·and·aspect·ratio.</p> | 545 | <p>This·example·illustrates·how·to·plot·multiple·maps·and·control·their·extent·and·aspect·ratio.</p> |
546 | <p>For·more·details·see·<a·class="reference·external"·href="https://github.com/pydata/xarray/issues/1397#issuecomment-299190567">this·discussion</a>·on·github.</p> | 546 | <p>For·more·details·see·<a·class="reference·external"·href="https://github.com/pydata/xarray/issues/1397#issuecomment-299190567">this·discussion</a>·on·github.</p> |
Offset 770, 15 lines modified | Offset 770, 15 lines modified | ||
770 | <span·class="ansi-green-intense-fg·ansi-bold">····200</span>·············<span·class="ansi-green-fg">except</span>·KeyError<span·class="ansi-blue-fg">:</span> | 770 | <span·class="ansi-green-intense-fg·ansi-bold">····200</span>·············<span·class="ansi-green-fg">except</span>·KeyError<span·class="ansi-blue-fg">:</span> |
771 | <span·class="ansi-green-fg">/build/reproducible-path/python-xarray-0.16.2/xarray/backends/lru_cache.py</span>·in·<span·class="ansi-cyan-fg">__getitem__</span><span·class="ansi-blue-fg">(self,·key)</span> | 771 | <span·class="ansi-green-fg">/build/reproducible-path/python-xarray-0.16.2/xarray/backends/lru_cache.py</span>·in·<span·class="ansi-cyan-fg">__getitem__</span><span·class="ansi-blue-fg">(self,·key)</span> |
772 | <span·class="ansi-green-intense-fg·ansi-bold">·····52</span>·········<span·class="ansi-green-fg">with</span>·self<span·class="ansi-blue-fg">.</span>_lock<span·class="ansi-blue-fg">:</span> | 772 | <span·class="ansi-green-intense-fg·ansi-bold">·····52</span>·········<span·class="ansi-green-fg">with</span>·self<span·class="ansi-blue-fg">.</span>_lock<span·class="ansi-blue-fg">:</span> |
773 | <span·class="ansi-green-fg">--->·53</span><span·class="ansi-red-fg">·············</span>value·<span·class="ansi-blue-fg">=</span>·self<span·class="ansi-blue-fg">.</span>_cache<span·class="ansi-blue-fg">[</span>key<span·class="ansi-blue-fg">]</span> | 773 | <span·class="ansi-green-fg">--->·53</span><span·class="ansi-red-fg">·············</span>value·<span·class="ansi-blue-fg">=</span>·self<span·class="ansi-blue-fg">.</span>_cache<span·class="ansi-blue-fg">[</span>key<span·class="ansi-blue-fg">]</span> |
774 | <span·class="ansi-green-intense-fg·ansi-bold">·····54</span>·············self<span·class="ansi-blue-fg">.</span>_cache<span·class="ansi-blue-fg">.</span>move_to_end<span·class="ansi-blue-fg">(</span>key<span·class="ansi-blue-fg">)</span> | 774 | <span·class="ansi-green-intense-fg·ansi-bold">·····54</span>·············self<span·class="ansi-blue-fg">.</span>_cache<span·class="ansi-blue-fg">.</span>move_to_end<span·class="ansi-blue-fg">(</span>key<span·class="ansi-blue-fg">)</span> |
775 | <span·class="ansi-red-fg">KeyError</span>:·[<function·open·at·0xffff7 | 775 | <span·class="ansi-red-fg">KeyError</span>:·[<function·open·at·0xffff787868b0>,·('https://github.com/mapbox/rasterio/raw/master/tests/data/RGB.byte.tif',),·'r',·()] |
776 | During·handling·of·the·above·exception,·another·exception·occurred: | 776 | During·handling·of·the·above·exception,·another·exception·occurred: |
777 | <span·class="ansi-red-fg">CPLE_HttpResponseError</span>····················Traceback·(most·recent·call·last) | 777 | <span·class="ansi-red-fg">CPLE_HttpResponseError</span>····················Traceback·(most·recent·call·last) |
778 | <span·class="ansi-green-fg">rasterio/_base.pyx</span>·in·<span·class="ansi-cyan-fg">rasterio._base.DatasetBase.__init__</span><span·class="ansi-blue-fg">()</span> | 778 | <span·class="ansi-green-fg">rasterio/_base.pyx</span>·in·<span·class="ansi-cyan-fg">rasterio._base.DatasetBase.__init__</span><span·class="ansi-blue-fg">()</span> |
779 | <span·class="ansi-green-fg">rasterio/_shim.pyx</span>·in·<span·class="ansi-cyan-fg">rasterio._shim.open_dataset</span><span·class="ansi-blue-fg">()</span> | 779 | <span·class="ansi-green-fg">rasterio/_shim.pyx</span>·in·<span·class="ansi-cyan-fg">rasterio._shim.open_dataset</span><span·class="ansi-blue-fg">()</span> |
Offset 889, 15 lines modified | Offset 889, 15 lines modified | ||
889 | <span·class="ansi-green-intense-fg·ansi-bold">····200</span>·············<span·class="ansi-green-fg">except</span>·KeyError<span·class="ansi-blue-fg">:</span> | 889 | <span·class="ansi-green-intense-fg·ansi-bold">····200</span>·············<span·class="ansi-green-fg">except</span>·KeyError<span·class="ansi-blue-fg">:</span> |
890 | <span·class="ansi-green-fg">/build/reproducible-path/python-xarray-0.16.2/xarray/backends/lru_cache.py</span>·in·<span·class="ansi-cyan-fg">__getitem__</span><span·class="ansi-blue-fg">(self,·key)</span> | 890 | <span·class="ansi-green-fg">/build/reproducible-path/python-xarray-0.16.2/xarray/backends/lru_cache.py</span>·in·<span·class="ansi-cyan-fg">__getitem__</span><span·class="ansi-blue-fg">(self,·key)</span> |
891 | <span·class="ansi-green-intense-fg·ansi-bold">·····52</span>·········<span·class="ansi-green-fg">with</span>·self<span·class="ansi-blue-fg">.</span>_lock<span·class="ansi-blue-fg">:</span> | 891 | <span·class="ansi-green-intense-fg·ansi-bold">·····52</span>·········<span·class="ansi-green-fg">with</span>·self<span·class="ansi-blue-fg">.</span>_lock<span·class="ansi-blue-fg">:</span> |
892 | <span·class="ansi-green-fg">--->·53</span><span·class="ansi-red-fg">·············</span>value·<span·class="ansi-blue-fg">=</span>·self<span·class="ansi-blue-fg">.</span>_cache<span·class="ansi-blue-fg">[</span>key<span·class="ansi-blue-fg">]</span> | 892 | <span·class="ansi-green-fg">--->·53</span><span·class="ansi-red-fg">·············</span>value·<span·class="ansi-blue-fg">=</span>·self<span·class="ansi-blue-fg">.</span>_cache<span·class="ansi-blue-fg">[</span>key<span·class="ansi-blue-fg">]</span> |
893 | <span·class="ansi-green-intense-fg·ansi-bold">·····54</span>·············self<span·class="ansi-blue-fg">.</span>_cache<span·class="ansi-blue-fg">.</span>move_to_end<span·class="ansi-blue-fg">(</span>key<span·class="ansi-blue-fg">)</span> | 893 | <span·class="ansi-green-intense-fg·ansi-bold">·····54</span>·············self<span·class="ansi-blue-fg">.</span>_cache<span·class="ansi-blue-fg">.</span>move_to_end<span·class="ansi-blue-fg">(</span>key<span·class="ansi-blue-fg">)</span> |
894 | <span·class="ansi-red-fg">KeyError</span>:·[<function·open·at·0xffff7 | 894 | <span·class="ansi-red-fg">KeyError</span>:·[<function·open·at·0xffff787868b0>,·('https://github.com/mapbox/rasterio/raw/master/tests/data/RGB.byte.tif',),·'r',·()] |
895 | During·handling·of·the·above·exception,·another·exception·occurred: | 895 | During·handling·of·the·above·exception,·another·exception·occurred: |
896 | <span·class="ansi-red-fg">CPLE_OpenFailedError</span>······················Traceback·(most·recent·call·last) | 896 | <span·class="ansi-red-fg">CPLE_OpenFailedError</span>······················Traceback·(most·recent·call·last) |
897 | <span·class="ansi-green-fg">rasterio/_base.pyx</span>·in·<span·class="ansi-cyan-fg">rasterio._base.DatasetBase.__init__</span><span·class="ansi-blue-fg">()</span> | 897 | <span·class="ansi-green-fg">rasterio/_base.pyx</span>·in·<span·class="ansi-cyan-fg">rasterio._base.DatasetBase.__init__</span><span·class="ansi-blue-fg">()</span> |
898 | <span·class="ansi-green-fg">rasterio/_shim.pyx</span>·in·<span·class="ansi-cyan-fg">rasterio._shim.open_dataset</span><span·class="ansi-blue-fg">()</span> | 898 | <span·class="ansi-green-fg">rasterio/_shim.pyx</span>·in·<span·class="ansi-cyan-fg">rasterio._shim.open_dataset</span><span·class="ansi-blue-fg">()</span> |
Offset 89, 15 lines modified | Offset 89, 15 lines modified | ||
89 | open_dataset(name,·cache,·cache_dir,·github_url,·branch,·**kws) | 89 | open_dataset(name,·cache,·cache_dir,·github_url,·branch,·**kws) |
90 | ·····76·········#·May·want·to·add·an·option·to·remove·it. | 90 | ·····76·········#·May·want·to·add·an·option·to·remove·it. |
91 | ·····77·········if·not·_os.path.isdir(longdir): | 91 | ·····77·········if·not·_os.path.isdir(longdir): |
92 | --->·78·············_os.mkdir(longdir) | 92 | --->·78·············_os.mkdir(longdir) |
93 | ·····79 | 93 | ·····79 |
94 | ·····80·········url·=·"/".join((github_url,·"raw",·branch,·fullname)) | 94 | ·····80·········url·=·"/".join((github_url,·"raw",·branch,·fullname)) |
95 | FileNotFoundError:·[Errno·2]·No·such·file·or·directory:·'/nonexistent/ | 95 | FileNotFoundError:·[Errno·2]·No·such·file·or·directory:·'/nonexistent/second- |
96 | build/.xarray_tutorial_data' | 96 | build/.xarray_tutorial_data' |
97 | *****·Multiple·plots·and·map·projections¶·***** | 97 | *****·Multiple·plots·and·map·projections¶·***** |
98 | Control·the·map·projection·parameters·on·multiple·axes | 98 | Control·the·map·projection·parameters·on·multiple·axes |
99 | This·example·illustrates·how·to·plot·multiple·maps·and·control·their·extent·and | 99 | This·example·illustrates·how·to·plot·multiple·maps·and·control·their·extent·and |
100 | aspect·ratio. | 100 | aspect·ratio. |
101 | For·more·details·see·this_discussion·on·github. | 101 | For·more·details·see·this_discussion·on·github. |
102 | [3]: | 102 | [3]: |
Offset 255, 15 lines modified | Offset 255, 15 lines modified | ||
255 | /build/reproducible-path/python-xarray-0.16.2/xarray/backends/lru_cache.py·in | 255 | /build/reproducible-path/python-xarray-0.16.2/xarray/backends/lru_cache.py·in |
256 | __getitem__(self,·key) | 256 | __getitem__(self,·key) |
257 | ·····52·········with·self._lock: | 257 | ·····52·········with·self._lock: |
258 | --->·53·············value·=·self._cache[key] | 258 | --->·53·············value·=·self._cache[key] |
259 | ·····54·············self._cache.move_to_end(key) | 259 | ·····54·············self._cache.move_to_end(key) |
260 | KeyError:·[<function·open·at·0xffff7 | 260 | KeyError:·[<function·open·at·0xffff787868b0>,·('https://github.com/mapbox/ |
261 | rasterio/raw/master/tests/data/RGB.byte.tif',),·'r',·()] | 261 | rasterio/raw/master/tests/data/RGB.byte.tif',),·'r',·()] |
262 | During·handling·of·the·above·exception,·another·exception·occurred: | 262 | During·handling·of·the·above·exception,·another·exception·occurred: |
263 | CPLE_HttpResponseError····················Traceback·(most·recent·call·last) | 263 | CPLE_HttpResponseError····················Traceback·(most·recent·call·last) |
264 | rasterio/_base.pyx·in·rasterio._base.DatasetBase.__init__() | 264 | rasterio/_base.pyx·in·rasterio._base.DatasetBase.__init__() |
Offset 374, 15 lines modified | Offset 374, 15 lines modified | ||
374 | /build/reproducible-path/python-xarray-0.16.2/xarray/backends/lru_cache.py·in | 374 | /build/reproducible-path/python-xarray-0.16.2/xarray/backends/lru_cache.py·in |
375 | __getitem__(self,·key) | 375 | __getitem__(self,·key) |
376 | ·····52·········with·self._lock: | 376 | ·····52·········with·self._lock: |
377 | --->·53·············value·=·self._cache[key] | 377 | --->·53·············value·=·self._cache[key] |
378 | ·····54·············self._cache.move_to_end(key) | 378 | ·····54·············self._cache.move_to_end(key) |
379 | KeyError:·[<function·open·at·0xffff7 | 379 | KeyError:·[<function·open·at·0xffff787868b0>,·('https://github.com/mapbox/ |
380 | rasterio/raw/master/tests/data/RGB.byte.tif',),·'r',·()] | 380 | rasterio/raw/master/tests/data/RGB.byte.tif',),·'r',·()] |
381 | During·handling·of·the·above·exception,·another·exception·occurred: | 381 | During·handling·of·the·above·exception,·another·exception·occurred: |
382 | CPLE_OpenFailedError······················Traceback·(most·recent·call·last) | 382 | CPLE_OpenFailedError······················Traceback·(most·recent·call·last) |
383 | rasterio/_base.pyx·in·rasterio._base.DatasetBase.__init__() | 383 | rasterio/_base.pyx·in·rasterio._base.DatasetBase.__init__() |
Offset 31, 23 lines modified | Offset 31, 23 lines modified | ||
31 | ········{ | 31 | ········{ |
32 | ············"cell_type":·"code", | 32 | ············"cell_type":·"code", |
33 | ············"execution_count":·2, | 33 | ············"execution_count":·2, |
34 | ············"metadata":·{}, | 34 | ············"metadata":·{}, |
35 | ············"outputs":·[ | 35 | ············"outputs":·[ |
36 | ················{ | 36 | ················{ |
37 | ····················"ename":·"FileNotFoundError", | 37 | ····················"ename":·"FileNotFoundError", |
38 | ····················"evalue":·"[Errno·2]·No·such·file·or·directory:·'/nonexistent/ | 38 | ····················"evalue":·"[Errno·2]·No·such·file·or·directory:·'/nonexistent/second-build/.xarray_tutorial_data'", |
39 | ····················"output_type":·"error", | 39 | ····················"output_type":·"error", |
40 | ····················"traceback":·[ | 40 | ····················"traceback":·[ |
41 | ························"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", | 41 | ························"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", |
42 | ························"\u001b[0;31mFileNotFoundError\u001b[0m·························Traceback·(most·recent·call·last)", | 42 | ························"\u001b[0;31mFileNotFoundError\u001b[0m·························Traceback·(most·recent·call·last)", |
43 | ························"\u001b[0;32m<ipython-input-2-15c698672cac>\u001b[0m·in·\u001b[0;36m<module>\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", | 43 | ························"\u001b[0;32m<ipython-input-2-15c698672cac>\u001b[0m·in·\u001b[0;36m<module>\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", |
44 | ························"\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", | 44 | ························"\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", |
45 | ························"\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", | 45 | ························"\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", |
46 | ························"\u001b[0;31mFileNotFoundError\u001b[0m:·[Errno·2]·No·such·file·or·directory:·'/nonexistent/ | 46 | ························"\u001b[0;31mFileNotFoundError\u001b[0m:·[Errno·2]·No·such·file·or·directory:·'/nonexistent/second-build/.xarray_tutorial_data'" |
47 | ····················] | 47 | ····················] |
48 | ················} | 48 | ················} |
49 | ············], | 49 | ············], |
50 | ············"source":·[ | 50 | ············"source":·[ |
51 | ················"ds·=·xr.tutorial.load_dataset('air_temperature')" | 51 | ················"ds·=·xr.tutorial.load_dataset('air_temperature')" |
52 | ············] | 52 | ············] |
53 | ········}, | 53 | ········}, |
Offset 275, 15 lines modified | Offset 275, 15 lines modified | ||
275 | ····················"evalue":·"CURL·error:·Could·not·resolve·host:·github.com", | 275 | ····················"evalue":·"CURL·error:·Could·not·resolve·host:·github.com", |
276 | ····················"output_type":·"error", | 276 | ····················"output_type":·"error", |
277 | ····················"traceback":·[ | 277 | ····················"traceback":·[ |
278 | ························"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", | 278 | ························"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", |
279 | ························"\u001b[0;31mKeyError\u001b[0m··································Traceback·(most·recent·call·last)", | 279 | ························"\u001b[0;31mKeyError\u001b[0m··································Traceback·(most·recent·call·last)", |
280 | ························"\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", | 280 | ························"\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", |
281 | ························"\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", | 281 | ························"\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", |
282 | ························"\u001b[0;31mKeyError\u001b[0m:·[<function·open·at·0xffff7 | 282 | ························"\u001b[0;31mKeyError\u001b[0m:·[<function·open·at·0xffff787868b0>,·('https://github.com/mapbox/rasterio/raw/master/tests/data/RGB.byte.tif',),·'r',·()]", |
283 | ························"\nDuring·handling·of·the·above·exception,·another·exception·occurred:\n", | 283 | ························"\nDuring·handling·of·the·above·exception,·another·exception·occurred:\n", |
284 | ························"\u001b[0;31mCPLE_HttpResponseError\u001b[0m····················Traceback·(most·recent·call·last)", | 284 | ························"\u001b[0;31mCPLE_HttpResponseError\u001b[0m····················Traceback·(most·recent·call·last)", |
285 | ························"\u001b[0;32mrasterio/_base.pyx\u001b[0m·in·\u001b[0;36mrasterio._base.DatasetBase.__init__\u001b[0;34m()\u001b[0m\n", | 285 | ························"\u001b[0;32mrasterio/_base.pyx\u001b[0m·in·\u001b[0;36mrasterio._base.DatasetBase.__init__\u001b[0;34m()\u001b[0m\n", |
286 | ························"\u001b[0;32mrasterio/_shim.pyx\u001b[0m·in·\u001b[0;36mrasterio._shim.open_dataset\u001b[0;34m()\u001b[0m\n", | 286 | ························"\u001b[0;32mrasterio/_shim.pyx\u001b[0m·in·\u001b[0;36mrasterio._shim.open_dataset\u001b[0;34m()\u001b[0m\n", |
287 | ························"\u001b[0;32mrasterio/_err.pyx\u001b[0m·in·\u001b[0;36mrasterio._err.exc_wrap_pointer\u001b[0;34m()\u001b[0m\n", | 287 | ························"\u001b[0;32mrasterio/_err.pyx\u001b[0m·in·\u001b[0;36mrasterio._err.exc_wrap_pointer\u001b[0;34m()\u001b[0m\n", |
288 | ························"\u001b[0;31mCPLE_HttpResponseError\u001b[0m:·CURL·error:·Could·not·resolve·host:·github.com", | 288 | ························"\u001b[0;31mCPLE_HttpResponseError\u001b[0m:·CURL·error:·Could·not·resolve·host:·github.com", |
289 | ························"\nDuring·handling·of·the·above·exception,·another·exception·occurred:\n", | 289 | ························"\nDuring·handling·of·the·above·exception,·another·exception·occurred:\n", |
Offset 338, 15 lines modified | Offset 338, 15 lines modified | ||
338 | ····················"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.", | 338 | ····················"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.", |
339 | ····················"output_type":·"error", | 339 | ····················"output_type":·"error", |
340 | ····················"traceback":·[ | 340 | ····················"traceback":·[ |
341 | ························"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", | 341 | ························"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", |
342 | ························"\u001b[0;31mKeyError\u001b[0m··································Traceback·(most·recent·call·last)", | 342 | ························"\u001b[0;31mKeyError\u001b[0m··································Traceback·(most·recent·call·last)", |
343 | ························"\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", | 343 | ························"\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", |
344 | ························"\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", | 344 | ························"\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", |
345 | ························"\u001b[0;31mKeyError\u001b[0m:·[<function·open·at·0xffff7 | 345 | ························"\u001b[0;31mKeyError\u001b[0m:·[<function·open·at·0xffff787868b0>,·('https://github.com/mapbox/rasterio/raw/master/tests/data/RGB.byte.tif',),·'r',·()]", |
346 | ························"\nDuring·handling·of·the·above·exception,·another·exception·occurred:\n", | 346 | ························"\nDuring·handling·of·the·above·exception,·another·exception·occurred:\n", |
347 | ························"\u001b[0;31mCPLE_OpenFailedError\u001b[0m······················Traceback·(most·recent·call·last)", | 347 | ························"\u001b[0;31mCPLE_OpenFailedError\u001b[0m······················Traceback·(most·recent·call·last)", |
348 | ························"\u001b[0;32mrasterio/_base.pyx\u001b[0m·in·\u001b[0;36mrasterio._base.DatasetBase.__init__\u001b[0;34m()\u001b[0m\n", | 348 | ························"\u001b[0;32mrasterio/_base.pyx\u001b[0m·in·\u001b[0;36mrasterio._base.DatasetBase.__init__\u001b[0;34m()\u001b[0m\n", |
349 | ························"\u001b[0;32mrasterio/_shim.pyx\u001b[0m·in·\u001b[0;36mrasterio._shim.open_dataset\u001b[0;34m()\u001b[0m\n", | 349 | ························"\u001b[0;32mrasterio/_shim.pyx\u001b[0m·in·\u001b[0;36mrasterio._shim.open_dataset\u001b[0;34m()\u001b[0m\n", |
350 | ························"\u001b[0;32mrasterio/_err.pyx\u001b[0m·in·\u001b[0;36mrasterio._err.exc_wrap_pointer\u001b[0;34m()\u001b[0m\n", | 350 | ························"\u001b[0;32mrasterio/_err.pyx\u001b[0m·in·\u001b[0;36mrasterio._err.exc_wrap_pointer\u001b[0;34m()\u001b[0m\n", |
351 | ························"\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.", | 351 | ························"\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.", |
352 | ························"\nDuring·handling·of·the·above·exception,·another·exception·occurred:\n", | 352 | ························"\nDuring·handling·of·the·above·exception,·another·exception·occurred:\n", |
Offset 889, 30 lines modified | Offset 889, 30 lines modified | ||
889 | </style><pre·class='xr-text-repr-fallback'><xarray.Dataset> | 889 | </style><pre·class='xr-text-repr-fallback'><xarray.Dataset> |
890 | Dimensions:···(location:·3,·time:·731) | 890 | Dimensions:···(location:·3,·time:·731) |
891 | Coordinates: | 891 | Coordinates: |
892 | ··*·time······(time)·datetime64[ns]·2000-01-01·2000-01-02·...·2001-12-31 | 892 | ··*·time······(time)·datetime64[ns]·2000-01-01·2000-01-02·...·2001-12-31 |
893 | ··*·location··(location)·<U2·'IA'·'IN'·'IL' | 893 | ··*·location··(location)·<U2·'IA'·'IN'·'IL' |
894 | Data·variables: | 894 | Data·variables: |
895 | ····tmin······(time,·location)·float64·-8.037·-1.788·-3.932·...·-1.346·-4.544 | 895 | ····tmin······(time,·location)·float64·-8.037·-1.788·-3.932·...·-1.346·-4.544 |
896 | ····tmax······(time,·location)·float64·12.98·3.31·6.779·...·6.636·3.343·3.805</pre><div·class='xr-wrap'·hidden><div·class='xr-header'><div·class='xr-obj-type'>xarray.Dataset</div></div><ul·class='xr-sections'><li·class='xr-section-item'><input·id='section- | 896 | ····tmax······(time,·location)·float64·12.98·3.31·6.779·...·6.636·3.343·3.805</pre><div·class='xr-wrap'·hidden><div·class='xr-header'><div·class='xr-obj-type'>xarray.Dataset</div></div><ul·class='xr-sections'><li·class='xr-section-item'><input·id='section-142ffa1e-4ed9-4430-ac6a-e9e3ca7bffaa'·class='xr-section-summary-in'·type='checkbox'·disabled·><label·for='section-142ffa1e-4ed9-4430-ac6a-e9e3ca7bffaa'·class='xr-section-summary'··title='Expand/collapse·section'>Dimensions:</label><div·class='xr-section-in[·...·truncated·by·diffoscope;·len:·1235,·SHA:·246b4b1ddaff508c027a580c729944f4a91173d9dcea8287a035761b05521238·...·]'·title='Show/Hide·data·repr'><svg·class='icon·xr-icon-database'><use·xlink:href='#icon-database'></use></svg></label><div·class='xr-var-attrs'><dl·class='xr-attrs'></dl></div><div·class='xr-var-data'><pre>array(['2000-01-01T00:00:00.000000000',·'2000-01-02T00:00:00.000000000', |
897 | ·······'2000-01-03T00:00:00.000000000',·...,·'2001-12-29T00:00:00.000000000', | 897 | ·······'2000-01-03T00:00:00.000000000',·...,·'2001-12-29T00:00:00.000000000', |
898 | ·······'2001-12-30T00:00:00.000000000',·'2001-12-31T00:00:00.000000000'], | 898 | ·······'2001-12-30T00:00:00.000000000',·'2001-12-31T00:00:00.000000000'], |
899 | ······dtype='datetime64[ns]')</pre></div></li><li·class='xr-var-item'><div·class='xr-var-name'><span·class='xr-has-index'>location</span></div><div·class='xr-var-dims'>(location)</div><div·class='xr-var-dtype'><U2</div><div·class='xr-var-preview·xr-preview'>'IA'·'IN'·'IL'</div><input·id='attrs- | 899 | ······dtype='datetime64[ns]')</pre></div></li><li·class='xr-var-item'><div·class='xr-var-name'><span·class='xr-has-index'>location</span></div><div·class='xr-var-dims'>(location)</div><div·class='xr-var-dtype'><U2</div><div·class='xr-var-preview·xr-preview'>'IA'·'IN'·'IL'</div><input·id='attrs-3f8c8605-8383-4602-9dcc-e7b2e33f47ca'·class='xr-var-attrs-in'·type='checkbox'·disabled><label·for='attrs-3f8c8605-8383-4602-9dcc-e7b2e33f47ca'·title='Show/Hide·attributes'><svg·class='icon·xr-icon-file-text2'><use·xlink:href='#icon-file-text2'></use></svg>[·...·truncated·by·diffoscope;·len:·1502,·SHA:·9b305180817a3f9d02a33df9b206422fa94f7cd43be310840f673ff0dfdd4a27·...·]'·title='Show/Hide·data·repr'><svg·class='icon·xr-icon-database'><use·xlink:href='#icon-database'></use></svg></label><div·class='xr-var-attrs'><dl·class='xr-attrs'></dl></div><div·class='xr-var-data'><pre>array([[·-8.03736932,··-1.78844117,··-3.93154201], |
900 | ·······[·-9.34115662,··-6.55807323,···0.13203714], | 900 | ·······[·-9.34115662,··-6.55807323,···0.13203714], |
901 | ·······[-12.13971902,··-6.14641918,··-1.06187252], | 901 | ·······[-12.13971902,··-6.14641918,··-1.06187252], |
902 | ·······..., | 902 | ·······..., |
903 | ·······[·-5.34723825,·-13.37459826,··-4.93221199], | 903 | ·······[·-5.34723825,·-13.37459826,··-4.93221199], |
904 | ·······[·-2.67283594,··-5.18072141,··-4.11567869], | 904 | ·······[·-2.67283594,··-5.18072141,··-4.11567869], |
905 | ·······[··2.06327582,··-1.34576404,··-4.54392729]])</pre></div></li><li·class='xr-var-item'><div·class='xr-var-name'><span>tmax</span></div><div·class='xr-var-dims'>(time,·location)</div><div·class='xr-var-dtype'>float64</div><div·class='xr-var-preview·xr-preview'>12.98·3.31·6.779·...·3.343·3.805</div><input·id='attrs- | 905 | ·······[··2.06327582,··-1.34576404,··-4.54392729]])</pre></div></li><li·class='xr-var-item'><div·class='xr-var-name'><span>tmax</span></div><div·class='xr-var-dims'>(time,·location)</div><div·class='xr-var-dtype'>float64</div><div·class='xr-var-preview·xr-preview'>12.98·3.31·6.779·...·3.343·3.805</div><input·id='attrs-a8f3bade-265b-477f-99ea-d9b109ec62ae'·class='xr-var-attrs-in'·type='checkbox'·disabled><label·for='attrs-a8f3bade-265b-477f-99ea-d9b109ec62ae'·title='Show/Hide·attributes'><svg·class='icon·xr-icon-file-text2'><use·xlink:href='#icon-file-text2'></use></svg>[·...·truncated·by·diffoscope;·len:·154,·SHA:·aabf0b7c1f8331779d1049cda9e0210385be57077e7d776f9fcc0d38639e31b4·...·]'·title='Show/Hide·data·repr'><svg·class='icon·xr-icon-database'><use·xlink:href='#icon-database'></use></svg></label><div·class='xr-var-attrs'><dl·class='xr-attrs'></dl></div><div·class='xr-var-data'><pre>array([[12.98054898,··3.31040942,··6.77855382], |
906 | ·······[·0.44785582,··6.37271154,··4.8434966·], | 906 | ·······[·0.44785582,··6.37271154,··4.8434966·], |
907 | ·······[·5.32269851,··6.25176289,··5.98033045], | 907 | ·······[·5.32269851,··6.25176289,··5.98033045], |
908 | ·······..., | 908 | ·······..., |
909 | ·······[·6.73078492,··7.74795302,··8.04569651], | 909 | ·······[·6.73078492,··7.74795302,··8.04569651], |
910 | ·······[·6.46376911,··6.31695352,··1.55799171], | 910 | ·······[·6.46376911,··6.31695352,··1.55799171], |
911 | ·······[·6.63593435,··3.34271537,··3.80527925]])</pre></div></li></ul></div></li><li·class='xr-section-item'><input·id='section- | 911 | ·······[·6.63593435,··3.34271537,··3.80527925]])</pre></div></li></ul></div></li><li·class='xr-section-item'><input·id='section-5412efa1-1569-4488-8c9b-8aa72f1a86c9'·class='xr-section-summary-in'·type='checkbox'·disabled·><label·for='section-5412efa1-1569-4488-8c9b-8aa72f1a86c9'·class='xr-section-summary'··title='Expand/collapse·section'>Attributes:·<span>(0)</span></label><div·class='xr-section-inline-details'></div><div·class='xr-section-details'><dl·class='xr-attrs'></dl></div></li></ul></div></div></div> |
912 | </div> | 912 | </div> |
913 | <div·class="section"·id="Examine-a-dataset-with-pandas-and-seaborn"> | 913 | <div·class="section"·id="Examine-a-dataset-with-pandas-and-seaborn"> |
914 | <h2>Examine·a·dataset·with·pandas·and·seaborn<a·class="headerlink"·href="#Examine-a-dataset-with-pandas-and-seaborn"·title="Permalink·to·this·headline">¶</a></h2> | 914 | <h2>Examine·a·dataset·with·pandas·and·seaborn<a·class="headerlink"·href="#Examine-a-dataset-with-pandas-and-seaborn"·title="Permalink·to·this·headline">¶</a></h2> |
915 | <div·class="section"·id="Convert-to-a-pandas-DataFrame"> | 915 | <div·class="section"·id="Convert-to-a-pandas-DataFrame"> |
916 | <h3>Convert·to·a·pandas·DataFrame<a·class="headerlink"·href="#Convert-to-a-pandas-DataFrame"·title="Permalink·to·this·headline">¶</a></h3> | 916 | <h3>Convert·to·a·pandas·DataFrame<a·class="headerlink"·href="#Convert-to-a-pandas-DataFrame"·title="Permalink·to·this·headline">¶</a></h3> |
917 | <div·class="nbinput·docutils·container"> | 917 | <div·class="nbinput·docutils·container"> |
918 | <div·class="prompt·highlight-none·notranslate"><div·class="highlight"><pre><span></span>[2]: | 918 | <div·class="prompt·highlight-none·notranslate"><div·class="highlight"><pre><span></span>[2]: |
Offset 1112, 15 lines modified | Offset 1112, 15 lines modified | ||
1112 | </div> | 1112 | </div> |
1113 | <div·class="nboutput·docutils·container"> | 1113 | <div·class="nboutput·docutils·container"> |
1114 | <div·class="prompt·highlight-none·notranslate"><div·class="highlight"><pre><span></span>[5]: | 1114 | <div·class="prompt·highlight-none·notranslate"><div·class="highlight"><pre><span></span>[5]: |
1115 | </pre></div> | 1115 | </pre></div> |
1116 | </div> | 1116 | </div> |
1117 | <div·class="output_area·docutils·container"> | 1117 | <div·class="output_area·docutils·container"> |
1118 | <div·class="highlight"><pre> | 1118 | <div·class="highlight"><pre> |
1119 | <seaborn.axisgrid.PairGrid·at·0xffff9 | 1119 | <seaborn.axisgrid.PairGrid·at·0xffff9745ecd0> |
1120 | </pre></div></div> | 1120 | </pre></div></div> |
1121 | </div> | 1121 | </div> |
1122 | <div·class="nboutput·nblast·docutils·container"> | 1122 | <div·class="nboutput·nblast·docutils·container"> |
1123 | <div·class="prompt·empty·docutils·container"> | 1123 | <div·class="prompt·empty·docutils·container"> |
1124 | </div> | 1124 | </div> |
1125 | <div·class="output_area·docutils·container"> | 1125 | <div·class="output_area·docutils·container"> |
1126 | <img·alt="../_images/examples_weather-data_9_1.png"·src="../_images/examples_weather-data_9_1.png"·/> | 1126 | <img·alt="../_images/examples_weather-data_9_1.png"·src="../_images/examples_weather-data_9_1.png"·/> |
Offset 1507, 26 lines modified | Offset 1507, 26 lines modified | ||
1507 | ·······[0.········,·0.········,·0.········], | 1507 | ·······[0.········,·0.········,·0.········], |
1508 | ·······[0.········,·0.········,·0.········], | 1508 | ·······[0.········,·0.········,·0.········], |
1509 | ·······[0.········,·0.01612903,·0.········], | 1509 | ·······[0.········,·0.01612903,·0.········], |
1510 | ·······[0.33333333,·0.35······,·0.23333333], | 1510 | ·······[0.33333333,·0.35······,·0.23333333], |
1511 | ·······[0.93548387,·0.85483871,·0.82258065]]) | 1511 | ·······[0.93548387,·0.85483871,·0.82258065]]) |
1512 | Coordinates: | 1512 | Coordinates: |
1513 | ··*·location··(location)·<U2·'IA'·'IN'·'IL' | 1513 | ··*·location··(location)·<U2·'IA'·'IN'·'IL' |
1514 | ··*·month·····(month)·int64·1·2·3·4·5·6·7·8·9·10·11·12</pre><div·class='xr-wrap'·hidden><div·class='xr-header'><div·class='xr-obj-type'>xarray.DataArray</div><div·class='xr-array-name'>'tmin'</div><ul·class='xr-dim-list'><li><span·class='xr-has-index'>month</span>:·12</li><li><span·class='xr-has-index'>location</span>:·3</li></ul></div><ul·class='xr-sections'><li·class='xr-section-item'><div·class='xr-array-wrap'><input·id='section- | 1514 | ··*·month·····(month)·int64·1·2·3·4·5·6·7·8·9·10·11·12</pre><div·class='xr-wrap'·hidden><div·class='xr-header'><div·class='xr-obj-type'>xarray.DataArray</div><div·class='xr-array-name'>'tmin'</div><ul·class='xr-dim-list'><li><span·class='xr-has-index'>month</span>:·12</li><li><span·class='xr-has-index'>location</span>:·3</li></ul></div><ul·class='xr-sections'><li·class='xr-section-item'><div·class='xr-array-wrap'><input·id='section-1b3fdce8-1269-4251-a0ec-970ba5f78c6b'·class='xr-array-in'·type='checkbox'·checked><label·for='section-1b3fdce8-1269-4251-a0ec-970ba5f78c6b'·title='Show/hide·data·repr'><svg·class='icon·xr-icon-database'><use·xlink:href='#icon-database'></use></svg></label><div·class='xr-array-preview·xr-preview'><span>0.9516·0.8871·0.9355·0.8421·0.7193·...·0.2333·0.9355·0.8548·0.8226</span></div><div·class='xr-array-data'><pre>array([[0.9516129·,·0.88709677,·0.93548387], |
1515 | ·······[0.84210526,·0.71929825,·0.77192982], | 1515 | ·······[0.84210526,·0.71929825,·0.77192982], |
1516 | ·······[0.24193548,·0.12903226,·0.16129032], | 1516 | ·······[0.24193548,·0.12903226,·0.16129032], |
1517 | ·······[0.········,·0.········,·0.········], | 1517 | ·······[0.········,·0.········,·0.········], |
1518 | ·······[0.········,·0.········,·0.········], | 1518 | ·······[0.········,·0.········,·0.········], |
1519 | ·······[0.········,·0.········,·0.········], | 1519 | ·······[0.········,·0.········,·0.········], |
1520 | ·······[0.········,·0.········,·0.········], | 1520 | ·······[0.········,·0.········,·0.········], |
1521 | ·······[0.········,·0.········,·0.········], | 1521 | ·······[0.········,·0.········,·0.········], |
1522 | ·······[0.········,·0.········,·0.········], | 1522 | ·······[0.········,·0.········,·0.········], |
1523 | ·······[0.········,·0.01612903,·0.········], | 1523 | ·······[0.········,·0.01612903,·0.········], |
1524 | ·······[0.33333333,·0.35······,·0.23333333], | 1524 | ·······[0.33333333,·0.35······,·0.23333333], |
1525 | ·······[0.93548387,·0.85483871,·0.82258065]])</pre></div></div></li><li·class='xr-section-item'><input·id='section- | 1525 | ·······[0.93548387,·0.85483871,·0.82258065]])</pre></div></div></li><li·class='xr-section-item'><input·id='section-2e31d36d-feee-43bf-9269-2b9e65f972c3'·class='xr-section-summary-in'·type='checkbox'··checked><label·for='section-2e31d36d-feee-43bf-9269-2b9e65f972c3'·class='xr-section-summary'·>Coordinates:·<span>(2)</span></label><div·class='xr-section-inline-details'><[·...·truncated·by·diffoscope;·len:·2215,·SHA:·e06122438fc4aa3be9747a52ff5aff8e546ed47562dc15e3d6f5b3f2e69fe932·...·]'·class='xr-section-summary'··title='Expand/collapse·section'>Attributes:·<span>(0)</span></label><div·class='xr-section-inline-details'></div><div·class='xr-section-details'><dl·class='xr-attrs'></dl></div></li></ul></div></div></div> |
1526 | </div> | 1526 | </div> |
1527 | <div·class="nbinput·docutils·container"> | 1527 | <div·class="nbinput·docutils·container"> |
1528 | <div·class="prompt·highlight-none·notranslate"><div·class="highlight"><pre><span></span>[7]: | 1528 | <div·class="prompt·highlight-none·notranslate"><div·class="highlight"><pre><span></span>[7]: |
1529 | </pre></div> | 1529 | </pre></div> |
1530 | </div> | 1530 | </div> |
1531 | <div·class="input_area·highlight-ipython3·notranslate"><div·class="highlight"><pre> | 1531 | <div·class="input_area·highlight-ipython3·notranslate"><div·class="highlight"><pre> |
1532 | <span></span><span·class="n">freeze</span><span·class="o">.</span><span·class="n">to_pandas</span><span·class="p">()</span><span·class="o">.</span><span·class="n">plot</span><span·class="p">()</span> | 1532 | <span></span><span·class="n">freeze</span><span·class="o">.</span><span·class="n">to_pandas</span><span·class="p">()</span><span·class="o">.</span><span·class="n">plot</span><span·class="p">()</span> |
Offset 2025, 18 lines modified | Offset 2025, 18 lines modified | ||
2025 | Dimensions:·······(location:·3,·time:·731) | 2025 | Dimensions:·······(location:·3,·time:·731) |
2026 | Coordinates: | 2026 | Coordinates: |
2027 | ··*·time··········(time)·datetime64[ns]·2000-01-01·2000-01-02·...·2001-12-31 | 2027 | ··*·time··········(time)·datetime64[ns]·2000-01-01·2000-01-02·...·2001-12-31 |
2028 | ··*·location······(location)·object·'IA'·'IN'·'IL' | 2028 | ··*·location······(location)·object·'IA'·'IN'·'IL' |
2029 | ····month·········(time)·int64·1·1·1·1·1·1·1·1·1·...·12·12·12·12·12·12·12·12·12 | 2029 | ····month·········(time)·int64·1·1·1·1·1·1·1·1·1·...·12·12·12·12·12·12·12·12·12 |
2030 | Data·variables: | 2030 | Data·variables: |
2031 | ····some_missing··(time,·location)·float64·nan·nan·nan·...·2.063·-1.346·-4.544 | 2031 | ····some_missing··(time,·location)·float64·nan·nan·nan·...·2.063·-1.346·-4.544 |
2032 | ····filled········(time,·location)·float64·-5.163·-4.216·...·-1.346·-4.544</pre><div·class='xr-wrap'·hidden><div·class='xr-header'><div·class='xr-obj-type'>xarray.Dataset</div></div><ul·class='xr-sections'><li·class='xr-section-item'><input·id='section- | 2032 | ····filled········(time,·location)·float64·-5.163·-4.216·...·-1.346·-4.544</pre><div·class='xr-wrap'·hidden><div·class='xr-header'><div·class='xr-obj-type'>xarray.Dataset</div></div><ul·class='xr-sections'><li·class='xr-section-item'><input·id='section-956d458f-665d-4a7a-89e0-3e2a6a3e179b'·class='xr-section-summary-in'·type='checkbox'·disabled·><label·for='section-956d458f-665d-4a7a-89e0-3e2a6a3e179b'·class='xr-section-summary'··title='Expand/collapse·section'>Dimensions:</label><div·class='xr-section-in[·...·truncated·by·diffoscope;·len:·1235,·SHA:·3d08c1599adcb41208cfe7a376324c4e3e74d083e4459666f22daf1e1993e4c2·...·]'·title='Show/Hide·data·repr'><svg·class='icon·xr-icon-database'><use·xlink:href='#icon-database'></use></svg></label><div·class='xr-var-attrs'><dl·class='xr-attrs'></dl></div><div·class='xr-var-data'><pre>array(['2000-01-01T00:00:00.000000000',·'2000-01-02T00:00:00.000000000', |
2033 | ·······'2000-01-03T00:00:00.000000000',·...,·'2001-12-29T00:00:00.000000000', | 2033 | ·······'2000-01-03T00:00:00.000000000',·...,·'2001-12-29T00:00:00.000000000', |
2034 | ·······'2001-12-30T00:00:00.000000000',·'2001-12-31T00:00:00.000000000'], | 2034 | ·······'2001-12-30T00:00:00.000000000',·'2001-12-31T00:00:00.000000000'], |
2035 | ······dtype='datetime64[ns]')</pre></div></li><li·class='xr-var-item'><div·class='xr-var-name'><span·class='xr-has-index'>location</span></div><div·class='xr-var-dims'>(location)</div><div·class='xr-var-dtype'>object</div><div·class='xr-var-preview·xr-preview'>'IA'·'IN'·'IL'</div><input·id='attrs- | 2035 | ······dtype='datetime64[ns]')</pre></div></li><li·class='xr-var-item'><div·class='xr-var-name'><span·class='xr-has-index'>location</span></div><div·class='xr-var-dims'>(location)</div><div·class='xr-var-dtype'>object</div><div·class='xr-var-preview·xr-preview'>'IA'·'IN'·'IL'</div><input·id='attrs-096a1be7-9f9c-4aed-94d7-04e999103ee4'·class='xr-var-attrs-in'·type='checkbox'·disabled><label·for='attrs-096a1be7-9f9c-4aed-94d7-04e999103ee4'·title='Show/Hide·attributes'><svg·class='icon·xr-icon-file-text2'><use·xlink:href='#icon-file-text2'></use></svg>[·...·truncated·by·diffoscope;·len:·1100,·SHA:·6e5fa43cfc6b1a2829e6f42661efb1c96bd5f0f1cf1ce5eaac7969040bda94a3·...·]'·title='Show/Hide·data·repr'><svg·class='icon·xr-icon-database'><use·xlink:href='#icon-database'></use></svg></label><div·class='xr-var-attrs'><dl·class='xr-attrs'></dl></div><div·class='xr-var-data'><pre>array([·1,··1,··1,··1,··1,··1,··1,··1,··1,··1,··1,··1,··1,··1,··1,··1,··1, |
2036 | ········1,··1,··1,··1,··1,··1,··1,··1,··1,··1,··1,··1,··1,··1,··2,··2,··2, | 2036 | ········1,··1,··1,··1,··1,··1,··1,··1,··1,··1,··1,··1,··1,··1,··2,··2,··2, |
2037 | ········2,··2,··2,··2,··2,··2,··2,··2,··2,··2,··2,··2,··2,··2,··2,··2,··2, | 2037 | ········2,··2,··2,··2,··2,··2,··2,··2,··2,··2,··2,··2,··2,··2,··2,··2,··2, |
2038 | ········2,··2,··2,··2,··2,··2,··2,··2,··2,··3,··3,··3,··3,··3,··3,··3,··3, | 2038 | ········2,··2,··2,··2,··2,··2,··2,··2,··2,··3,··3,··3,··3,··3,··3,··3,··3, |
2039 | ········3,··3,··3,··3,··3,··3,··3,··3,··3,··3,··3,··3,··3,··3,··3,··3,··3, | 2039 | ········3,··3,··3,··3,··3,··3,··3,··3,··3,··3,··3,··3,··3,··3,··3,··3,··3, |
2040 | ········3,··3,··3,··3,··3,··3,··4,··4,··4,··4,··4,··4,··4,··4,··4,··4,··4, | 2040 | ········3,··3,··3,··3,··3,··3,··4,··4,··4,··4,··4,··4,··4,··4,··4,··4,··4, |
2041 | ········4,··4,··4,··4,··4,··4,··4,··4,··4,··4,··4,··4,··4,··4,··4,··4,··4, | 2041 | ········4,··4,··4,··4,··4,··4,··4,··4,··4,··4,··4,··4,··4,··4,··4,··4,··4, |
2042 | ········4,··4,··5,··5,··5,··5,··5,··5,··5,··5,··5,··5,··5,··5,··5,··5,··5, | 2042 | ········4,··4,··5,··5,··5,··5,··5,··5,··5,··5,··5,··5,··5,··5,··5,··5,··5, |
Offset 2068, 27 lines modified | Offset 2068, 27 lines modified | ||
2068 | ········8,··8,··8,··8,··8,··8,··8,··8,··8,··8,··8,··8,··8,··8,··9,··9,··9, | 2068 | ········8,··8,··8,··8,··8,··8,··8,··8,··8,··8,··8,··8,··8,··8,··9,··9,··9, |
2069 | ········9,··9,··9,··9,··9,··9,··9,··9,··9,··9,··9,··9,··9,··9,··9,··9,··9, | 2069 | ········9,··9,··9,··9,··9,··9,··9,··9,··9,··9,··9,··9,··9,··9,··9,··9,··9, |
2070 | ········9,··9,··9,··9,··9,··9,··9,··9,··9,··9,·10,·10,·10,·10,·10,·10,·10, | 2070 | ········9,··9,··9,··9,··9,··9,··9,··9,··9,··9,·10,·10,·10,·10,·10,·10,·10, |
2071 | ·······10,·10,·10,·10,·10,·10,·10,·10,·10,·10,·10,·10,·10,·10,·10,·10,·10, | 2071 | ·······10,·10,·10,·10,·10,·10,·10,·10,·10,·10,·10,·10,·10,·10,·10,·10,·10, |
2072 | ·······10,·10,·10,·10,·10,·10,·10,·11,·11,·11,·11,·11,·11,·11,·11,·11,·11, | 2072 | ·······10,·10,·10,·10,·10,·10,·10,·11,·11,·11,·11,·11,·11,·11,·11,·11,·11, |
2073 | ·······11,·11,·11,·11,·11,·11,·11,·11,·11,·11,·11,·11,·11,·11,·11,·11,·11, | 2073 | ·······11,·11,·11,·11,·11,·11,·11,·11,·11,·11,·11,·11,·11,·11,·11,·11,·11, |
2074 | ·······11,·11,·11,·12,·12,·12,·12,·12,·12,·12,·12,·12,·12,·12,·12,·12,·12, | 2074 | ·······11,·11,·11,·12,·12,·12,·12,·12,·12,·12,·12,·12,·12,·12,·12,·12,·12, |
2075 | ·······12,·12,·12,·12,·12,·12,·12,·12,·12,·12,·12,·12,·12,·12,·12,·12,·12])</pre></div></li></ul></div></li><li·class='xr-section-item'><input·id='section- | 2075 | ·······12,·12,·12,·12,·12,·12,·12,·12,·12,·12,·12,·12,·12,·12,·12,·12,·12])</pre></div></li></ul></div></li><li·class='xr-section-item'><input·id='section-bb363f93-6314-4da9-b770-6f04c797f033'·class='xr-section-summary-in'·type='checkbox'··checked><label·for='section-bb363f93-6314-4da9-b770-6f04c797f033'·class='xr-section-summary'·>Data·variables:·<span>(2)</span></label><div·class='xr-section-inline-details[·...·truncated·by·diffoscope;·len:·737,·SHA:·5c049520e93f8c1b813be97884339037d3df8784566cf45b449e5cfa0fd33f95·...·]'·title='Show/Hide·data·repr'><svg·class='icon·xr-icon-database'><use·xlink:href='#icon-database'></use></svg></label><div·class='xr-var-attrs'><dl·class='xr-attrs'></dl></div><div·class='xr-var-data'><pre>array([[·········nan,··········nan,··········nan], |
2076 | ·······[·········nan,··········nan,··········nan], | 2076 | ·······[·········nan,··········nan,··········nan], |
2077 | ·······[·········nan,··········nan,··········nan], | 2077 | ·······[·········nan,··········nan,··········nan], |
2078 | ·······..., | 2078 | ·······..., |
2079 | ·······[·-5.34723825,·-13.37459826,··-4.93221199], | 2079 | ·······[·-5.34723825,·-13.37459826,··-4.93221199], |
2080 | ·······[·-2.67283594,··-5.18072141,··-4.11567869], | 2080 | ·······[·-2.67283594,··-5.18072141,··-4.11567869], |
2081 | ·······[··2.06327582,··-1.34576404,··-4.54392729]])</pre></div></li><li·class='xr-var-item'><div·class='xr-var-name'><span>filled</span></div><div·class='xr-var-dims'>(time,·location)</div><div·class='xr-var-dtype'>float64</div><div·class='xr-var-preview·xr-preview'>-5.163·-4.216·...·-1.346·-4.544</div><input·id='attrs- | 2081 | ·······[··2.06327582,··-1.34576404,··-4.54392729]])</pre></div></li><li·class='xr-var-item'><div·class='xr-var-name'><span>filled</span></div><div·class='xr-var-dims'>(time,·location)</div><div·class='xr-var-dtype'>float64</div><div·class='xr-var-preview·xr-preview'>-5.163·-4.216·...·-1.346·-4.544</div><input·id='attrs-f8d92454-61bb-4571-bd34-c1ca3e056519'·class='xr-var-attrs-in'·type='checkbox'·disabled><label·for='attrs-f8d92454-61bb-4571-bd34-c1ca3e056519'·title='Show/Hide·attributes'><svg·class='icon·xr-icon-file-text2'><use·xlink:href='#icon-file-text2'></use></svg>[·...·truncated·by·diffoscope;·len:·154,·SHA:·2b736be94199fe08e6ed62db515c65b038dad2c41e100936a049f79f2648bd0b·...·]'·title='Show/Hide·data·repr'><svg·class='icon·xr-icon-database'><use·xlink:href='#icon-database'></use></svg></label><div·class='xr-var-attrs'><dl·class='xr-attrs'></dl></div><div·class='xr-var-data'><pre>array([[·-5.16274935,··-4.21616663,··-4.68137385], |
2082 | ·······[·-5.16274935,··-4.21616663,··-4.68137385], | 2082 | ·······[·-5.16274935,··-4.21616663,··-4.68137385], |
2083 | ·······[·-5.16274935,··-4.21616663,··-4.68137385], | 2083 | ·······[·-5.16274935,··-4.21616663,··-4.68137385], |
2084 | ·······..., | 2084 | ·······..., |
2085 | ·······[·-5.34723825,·-13.37459826,··-4.93221199], | 2085 | ·······[·-5.34723825,·-13.37459826,··-4.93221199], |
2086 | ·······[·-2.67283594,··-5.18072141,··-4.11567869], | 2086 | ·······[·-2.67283594,··-5.18072141,··-4.11567869], |
2087 | ·······[··2.06327582,··-1.34576404,··-4.54392729]])</pre></div></li></ul></div></li><li·class='xr-section-item'><input·id='section- | 2087 | ·······[··2.06327582,··-1.34576404,··-4.54392729]])</pre></div></li></ul></div></li><li·class='xr-section-item'><input·id='section-0496a124-c104-4ffb-a62e-4b13228c8166'·class='xr-section-summary-in'·type='checkbox'·disabled·><label·for='section-0496a124-c104-4ffb-a62e-4b13228c8166'·class='xr-section-summary'··title='Expand/collapse·section'>Attributes:·<span>(0)</span></label><div·class='xr-section-inline-details'></div><div·class='xr-section-details'><dl·class='xr-attrs'></dl></div></li></ul></div></div></div> |
2088 | </div> | 2088 | </div> |
2089 | <div·class="nbinput·docutils·container"> | 2089 | <div·class="nbinput·docutils·container"> |
2090 | <div·class="prompt·highlight-none·notranslate"><div·class="highlight"><pre><span></span>[12]: | 2090 | <div·class="prompt·highlight-none·notranslate"><div·class="highlight"><pre><span></span>[12]: |
2091 | </pre></div> | 2091 | </pre></div> |
2092 | </div> | 2092 | </div> |
2093 | <div·class="input_area·highlight-ipython3·notranslate"><div·class="highlight"><pre> | 2093 | <div·class="input_area·highlight-ipython3·notranslate"><div·class="highlight"><pre> |
2094 | <span></span><span·class="n">df</span>·<span·class="o">=</span>·<span·class="n">both</span><span·class="o">.</span><span·class="n">sel</span><span·class="p">(</span><span·class="n">time</span><span·class="o">=</span><span·class="s2">"2000"</span><span·class="p">)</span><span·class="o">.</span><span·class="n">mean</span><span·class="p">(</span><span·class="s2">"location"</span><span·class="p">)</span><span·class="o">.</span><span·class="n">reset_coords</span><span·class="p">(</span><span·class="n">drop</span><span·class="o">=</span><span·class="kc">True</span><span·class="p">)</span><span·class="o">.</span><span·class="n">to_dataframe</span><span·class="p">()</span> | 2094 | <span></span><span·class="n">df</span>·<span·class="o">=</span>·<span·class="n">both</span><span·class="o">.</span><span·class="n">sel</span><span·class="p">(</span><span·class="n">time</span><span·class="o">=</span><span·class="s2">"2000"</span><span·class="p">)</span><span·class="o">.</span><span·class="n">mean</span><span·class="p">(</span><span·class="s2">"location"</span><span·class="p">)</span><span·class="o">.</span><span·class="n">reset_coords</span><span·class="p">(</span><span·class="n">drop</span><span·class="o">=</span><span·class="kc">True</span><span·class="p">)</span><span·class="o">.</span><span·class="n">to_dataframe</span><span·class="p">()</span> |
Offset 188, 15 lines modified | Offset 188, 15 lines modified | ||
188 | [4]: | 188 | [4]: |
189 | <AxesSubplot:xlabel='time'> | 189 | <AxesSubplot:xlabel='time'> |
190 | [../_images/examples_weather-data_7_1.png] | 190 | [../_images/examples_weather-data_7_1.png] |
191 | ****·Visualize·using·seaborn¶·**** | 191 | ****·Visualize·using·seaborn¶·**** |
192 | [5]: | 192 | [5]: |
193 | sns.pairplot(df.reset_index(),·vars=ds.data_vars) | 193 | sns.pairplot(df.reset_index(),·vars=ds.data_vars) |
194 | [5]: | 194 | [5]: |
195 | <seaborn.axisgrid.PairGrid·at·0xffff9 | 195 | <seaborn.axisgrid.PairGrid·at·0xffff9745ecd0> |
196 | [../_images/examples_weather-data_9_1.png] | 196 | [../_images/examples_weather-data_9_1.png] |
197 | *****·Probability·of·freeze·by·calendar·month¶·***** | 197 | *****·Probability·of·freeze·by·calendar·month¶·***** |
198 | [6]: | 198 | [6]: |
199 | freeze·=·(ds["tmin"]·<=·0).groupby("time.month").mean("time") | 199 | freeze·=·(ds["tmin"]·<=·0).groupby("time.month").mean("time") |
200 | freeze | 200 | freeze |
201 | [6]: | 201 | [6]: |
Offset 377, 30 lines modified | Offset 377, 30 lines modified | ||
377 | ····························"</style><pre·class='xr-text-repr-fallback'><xarray.Dataset>\n", | 377 | ····························"</style><pre·class='xr-text-repr-fallback'><xarray.Dataset>\n", |
378 | ····························"Dimensions:···(location:·3,·time:·731)\n", | 378 | ····························"Dimensions:···(location:·3,·time:·731)\n", |
379 | ····························"Coordinates:\n", | 379 | ····························"Coordinates:\n", |
380 | ····························"··*·time······(time)·datetime64[ns]·2000-01-01·2000-01-02·...·2001-12-31\n", | 380 | ····························"··*·time······(time)·datetime64[ns]·2000-01-01·2000-01-02·...·2001-12-31\n", |
381 | ····························"··*·location··(location)·<U2·'IA'·'IN'·'IL'\n", | 381 | ····························"··*·location··(location)·<U2·'IA'·'IN'·'IL'\n", |
382 | ····························"Data·variables:\n", | 382 | ····························"Data·variables:\n", |
383 | ····························"····tmin······(time,·location)·float64·-8.037·-1.788·-3.932·...·-1.346·-4.544\n", | 383 | ····························"····tmin······(time,·location)·float64·-8.037·-1.788·-3.932·...·-1.346·-4.544\n", |
384 | ····························"····tmax······(time,·location)·float64·12.98·3.31·6.779·...·6.636·3.343·3.805</pre><div·class='xr-wrap'·hidden><div·class='xr-header'><div·class='xr-obj-type'>xarray.Dataset</div></div><ul·class='xr-sections'><li·class='xr-section-item'><input·id='section- | 384 | ····························"····tmax······(time,·location)·float64·12.98·3.31·6.779·...·6.636·3.343·3.805</pre><div·class='xr-wrap'·hidden><div·class='xr-header'><div·class='xr-obj-type'>xarray.Dataset</div></div><ul·class='xr-sections'><li·class='xr-section-item'><input·id='section-142ffa1e-4ed9-4430-ac6a-e9e3ca7bffaa'·class='xr-section-summary-in'·type='checkbox'·disabled·><label·for='section-142ffa1e-4ed9-4430-ac6a-e9e3ca7bffaa'·class='xr-section-summary'··title='Expand/collapse·section'>Dimensions:</label><div·class='xr-section-in[·...·truncated·by·diffoscope;·len:·1235,·SHA:·246b4b1ddaff508c027a580c729944f4a91173d9dcea8287a035761b05521238·...·]'·title='Show/Hide·data·repr'><svg·class='icon·xr-icon-database'><use·xlink:href='#icon-database'></use></svg></label><div·class='xr-var-attrs'><dl·class='xr-attrs'></dl></div><div·class='xr-var-data'><pre>array(['2000-01-01T00:00:00.000000000',·'2000-01-02T00:00:00.000000000',\n", |
385 | ····························"·······'2000-01-03T00:00:00.000000000',·...,·'2001-12-29T00:00:00.000000000',\n", | 385 | ····························"·······'2000-01-03T00:00:00.000000000',·...,·'2001-12-29T00:00:00.000000000',\n", |
386 | ····························"·······'2001-12-30T00:00:00.000000000',·'2001-12-31T00:00:00.000000000'],\n", | 386 | ····························"·······'2001-12-30T00:00:00.000000000',·'2001-12-31T00:00:00.000000000'],\n", |
387 | ····························"······dtype='datetime64[ns]')</pre></div></li><li·class='xr-var-item'><div·class='xr-var-name'><span·class='xr-has-index'>location</span></div><div·class='xr-var-dims'>(location)</div><div·class='xr-var-dtype'><U2</div><div·class='xr-var-preview·xr-preview'>'IA'·'IN'·'IL'</div><input·id='attrs- | 387 | ····························"······dtype='datetime64[ns]')</pre></div></li><li·class='xr-var-item'><div·class='xr-var-name'><span·class='xr-has-index'>location</span></div><div·class='xr-var-dims'>(location)</div><div·class='xr-var-dtype'><U2</div><div·class='xr-var-preview·xr-preview'>'IA'·'IN'·'IL'</div><input·id='attrs-3f8c8605-8383-4602-9dcc-e7b2e33f47ca'·class='xr-var-attrs-in'·type='checkbox'·disabled><label·for='attrs-3f8c8605-8383-4602-9dcc-e7b2e33f47ca'·title='Show/Hide·attributes'><svg·class='icon·xr-icon-file-text2'><use·xlink:href='#icon-file-text2'></use></svg>[·...·truncated·by·diffoscope;·len:·1502,·SHA:·9b305180817a3f9d02a33df9b206422fa94f7cd43be310840f673ff0dfdd4a27·...·]'·title='Show/Hide·data·repr'><svg·class='icon·xr-icon-database'><use·xlink:href='#icon-database'></use></svg></label><div·class='xr-var-attrs'><dl·class='xr-attrs'></dl></div><div·class='xr-var-data'><pre>array([[·-8.03736932,··-1.78844117,··-3.93154201],\n", |
388 | ····························"·······[·-9.34115662,··-6.55807323,···0.13203714],\n", | 388 | ····························"·······[·-9.34115662,··-6.55807323,···0.13203714],\n", |
389 | ····························"·······[-12.13971902,··-6.14641918,··-1.06187252],\n", | 389 | ····························"·······[-12.13971902,··-6.14641918,··-1.06187252],\n", |
390 | ····························"·······...,\n", | 390 | ····························"·······...,\n", |
391 | ····························"·······[·-5.34723825,·-13.37459826,··-4.93221199],\n", | 391 | ····························"·······[·-5.34723825,·-13.37459826,··-4.93221199],\n", |
392 | ····························"·······[·-2.67283594,··-5.18072141,··-4.11567869],\n", | 392 | ····························"·······[·-2.67283594,··-5.18072141,··-4.11567869],\n", |
393 | ····························"·······[··2.06327582,··-1.34576404,··-4.54392729]])</pre></div></li><li·class='xr-var-item'><div·class='xr-var-name'><span>tmax</span></div><div·class='xr-var-dims'>(time,·location)</div><div·class='xr-var-dtype'>float64</div><div·class='xr-var-preview·xr-preview'>12.98·3.31·6.779·...·3.343·3.805</div><input·id='attrs- | 393 | ····························"·······[··2.06327582,··-1.34576404,··-4.54392729]])</pre></div></li><li·class='xr-var-item'><div·class='xr-var-name'><span>tmax</span></div><div·class='xr-var-dims'>(time,·location)</div><div·class='xr-var-dtype'>float64</div><div·class='xr-var-preview·xr-preview'>12.98·3.31·6.779·...·3.343·3.805</div><input·id='attrs-a8f3bade-265b-477f-99ea-d9b109ec62ae'·class='xr-var-attrs-in'·type='checkbox'·disabled><label·for='attrs-a8f3bade-265b-477f-99ea-d9b109ec62ae'·title='Show/Hide·attributes'><svg·class='icon·xr-icon-file-text2'><use·xlink:href='#icon-file-text2'></use></svg>[·...·truncated·by·diffoscope;·len:·154,·SHA:·aabf0b7c1f8331779d1049cda9e0210385be57077e7d776f9fcc0d38639e31b4·...·]'·title='Show/Hide·data·repr'><svg·class='icon·xr-icon-database'><use·xlink:href='#icon-database'></use></svg></label><div·class='xr-var-attrs'><dl·class='xr-attrs'></dl></div><div·class='xr-var-data'><pre>array([[12.98054898,··3.31040942,··6.77855382],\n", |
394 | ····························"·······[·0.44785582,··6.37271154,··4.8434966·],\n", | 394 | ····························"·······[·0.44785582,··6.37271154,··4.8434966·],\n", |
395 | ····························"·······[·5.32269851,··6.25176289,··5.98033045],\n", | 395 | ····························"·······[·5.32269851,··6.25176289,··5.98033045],\n", |
396 | ····························"·······...,\n", | 396 | ····························"·······...,\n", |
397 | ····························"·······[·6.73078492,··7.74795302,··8.04569651],\n", | 397 | ····························"·······[·6.73078492,··7.74795302,··8.04569651],\n", |
398 | ····························"·······[·6.46376911,··6.31695352,··1.55799171],\n", | 398 | ····························"·······[·6.46376911,··6.31695352,··1.55799171],\n", |
399 | ····························"·······[·6.63593435,··3.34271537,··3.80527925]])</pre></div></li></ul></div></li><li·class='xr-section-item'><input·id='section- | 399 | ····························"·······[·6.63593435,··3.34271537,··3.80527925]])</pre></div></li></ul></div></li><li·class='xr-section-item'><input·id='section-5412efa1-1569-4488-8c9b-8aa72f1a86c9'·class='xr-section-summary-in'·type='checkbox'·disabled·><label·for='section-5412efa1-1569-4488-8c9b-8aa72f1a86c9'·class='xr-section-summary'··title='Expand/collapse·section'>Attributes:·<span>(0)</span></label><div·class='xr-section-inline-details'></div><div·class='xr-section-details'><dl·class='xr-attrs'></dl></div></li></ul></div></div>" |
400 | ························], | 400 | ························], |
401 | ························"text/plain":·[ | 401 | ························"text/plain":·[ |
402 | ····························"<xarray.Dataset>\n", | 402 | ····························"<xarray.Dataset>\n", |
403 | ····························"Dimensions:···(location:·3,·time:·731)\n", | 403 | ····························"Dimensions:···(location:·3,·time:·731)\n", |
404 | ····························"Coordinates:\n", | 404 | ····························"Coordinates:\n", |
405 | ····························"··*·time······(time)·datetime64[ns]·2000-01-01·2000-01-02·...·2001-12-31\n", | 405 | ····························"··*·time······(time)·datetime64[ns]·2000-01-01·2000-01-02·...·2001-12-31\n", |
406 | ····························"··*·location··(location)·<U2·'IA'·'IN'·'IL'\n", | 406 | ····························"··*·location··(location)·<U2·'IA'·'IN'·'IL'\n", |
Offset 711, 15 lines modified | Offset 711, 15 lines modified | ||
711 | ····················"start_time":·"2020-01-27T15:47:37.202479Z" | 711 | ····················"start_time":·"2020-01-27T15:47:37.202479Z" |
712 | ················} | 712 | ················} |
713 | ············}, | 713 | ············}, |
714 | ············"outputs":·[ | 714 | ············"outputs":·[ |
715 | ················{ | 715 | ················{ |
716 | ····················"data":·{ | 716 | ····················"data":·{ |
717 | ························"text/plain":·[ | 717 | ························"text/plain":·[ |
718 | ····························"<seaborn.axisgrid.PairGrid·at·0xffff9 | 718 | ····························"<seaborn.axisgrid.PairGrid·at·0xffff9745ecd0>" |
719 | ························] | 719 | ························] |
720 | ····················}, | 720 | ····················}, |
721 | ····················"execution_count":·5, | 721 | ····················"execution_count":·5, |
722 | ····················"metadata":·{}, | 722 | ····················"metadata":·{}, |
723 | ····················"output_type":·"execute_result" | 723 | ····················"output_type":·"execute_result" |
724 | ················}, | 724 | ················}, |
725 | ················{ | 725 | ················{ |
Offset 1121, 26 lines modified | Offset 1121, 26 lines modified | ||
1121 | ····························"·······[0.········,·0.········,·0.········],\n", | 1121 | ····························"·······[0.········,·0.········,·0.········],\n", |
1122 | ····························"·······[0.········,·0.········,·0.········],\n", | 1122 | ····························"·······[0.········,·0.········,·0.········],\n", |
1123 | ····························"·······[0.········,·0.01612903,·0.········],\n", | 1123 | ····························"·······[0.········,·0.01612903,·0.········],\n", |
1124 | ····························"·······[0.33333333,·0.35······,·0.23333333],\n", | 1124 | ····························"·······[0.33333333,·0.35······,·0.23333333],\n", |
1125 | ····························"·······[0.93548387,·0.85483871,·0.82258065]])\n", | 1125 | ····························"·······[0.93548387,·0.85483871,·0.82258065]])\n", |
1126 | ····························"Coordinates:\n", | 1126 | ····························"Coordinates:\n", |
1127 | ····························"··*·location··(location)·<U2·'IA'·'IN'·'IL'\n", | 1127 | ····························"··*·location··(location)·<U2·'IA'·'IN'·'IL'\n", |
1128 | ····························"··*·month·····(month)·int64·1·2·3·4·5·6·7·8·9·10·11·12</pre><div·class='xr-wrap'·hidden><div·class='xr-header'><div·class='xr-obj-type'>xarray.DataArray</div><div·class='xr-array-name'>'tmin'</div><ul·class='xr-dim-list'><li><span·class='xr-has-index'>month</span>:·12</li><li><span·class='xr-has-index'>location</span>:·3</li></ul></div><ul·class='xr-sections'><li·class='xr-section-item'><div·class='xr-array-wrap'><input·id='section- | 1128 | ····························"··*·month·····(month)·int64·1·2·3·4·5·6·7·8·9·10·11·12</pre><div·class='xr-wrap'·hidden><div·class='xr-header'><div·class='xr-obj-type'>xarray.DataArray</div><div·class='xr-array-name'>'tmin'</div><ul·class='xr-dim-list'><li><span·class='xr-has-index'>month</span>:·12</li><li><span·class='xr-has-index'>location</span>:·3</li></ul></div><ul·class='xr-sections'><li·class='xr-section-item'><div·class='xr-array-wrap'><input·id='section-1b3fdce8-1269-4251-a0ec-970ba5f78c6b'·class='xr-array-in'·type='checkbox'·checked><label·for='section-1b3fdce8-1269-4251-a0ec-970ba5f78c6b'·title='Show/hide·data·repr'><svg·class='icon·xr-icon-database'><use·xlink:href='#icon-database'></use></svg></label><div·class='xr-array-preview·xr-preview'><span>0.9516·0.8871·0.9355·0.8421·0.7193·...·0.2333·0.9355·0.8548·0.8226</span></div><div·class='xr-array-data'><pre>array([[0.9516129·,·0.88709677,·0.93548387],\n", |
1129 | ····························"·······[0.84210526,·0.71929825,·0.77192982],\n", | 1129 | ····························"·······[0.84210526,·0.71929825,·0.77192982],\n", |
1130 | ····························"·······[0.24193548,·0.12903226,·0.16129032],\n", | 1130 | ····························"·······[0.24193548,·0.12903226,·0.16129032],\n", |
1131 | ····························"·······[0.········,·0.········,·0.········],\n", | 1131 | ····························"·······[0.········,·0.········,·0.········],\n", |
1132 | ····························"·······[0.········,·0.········,·0.········],\n", | 1132 | ····························"·······[0.········,·0.········,·0.········],\n", |
1133 | ····························"·······[0.········,·0.········,·0.········],\n", | 1133 | ····························"·······[0.········,·0.········,·0.········],\n", |
1134 | ····························"·······[0.········,·0.········,·0.········],\n", | 1134 | ····························"·······[0.········,·0.········,·0.········],\n", |
1135 | ····························"·······[0.········,·0.········,·0.········],\n", | 1135 | ····························"·······[0.········,·0.········,·0.········],\n", |
1136 | ····························"·······[0.········,·0.········,·0.········],\n", | 1136 | ····························"·······[0.········,·0.········,·0.········],\n", |
1137 | ····························"·······[0.········,·0.01612903,·0.········],\n", | 1137 | ····························"·······[0.········,·0.01612903,·0.········],\n", |
1138 | ····························"·······[0.33333333,·0.35······,·0.23333333],\n", | 1138 | ····························"·······[0.33333333,·0.35······,·0.23333333],\n", |
1139 | ····························"·······[0.93548387,·0.85483871,·0.82258065]])</pre></div></div></li><li·class='xr-section-item'><input·id='section- | 1139 | ····························"·······[0.93548387,·0.85483871,·0.82258065]])</pre></div></div></li><li·class='xr-section-item'><input·id='section-2e31d36d-feee-43bf-9269-2b9e65f972c3'·class='xr-section-summary-in'·type='checkbox'··checked><label·for='section-2e31d36d-feee-43bf-9269-2b9e65f972c3'·class='xr-section-summary'·>Coordinates:·<span>(2)</span></label><div·class='xr-section-inline-details'><[·...·truncated·by·diffoscope;·len:·2215,·SHA:·e06122438fc4aa3be9747a52ff5aff8e546ed47562dc15e3d6f5b3f2e69fe932·...·]'·class='xr-section-summary'··title='Expand/collapse·section'>Attributes:·<span>(0)</span></label><div·class='xr-section-inline-details'></div><div·class='xr-section-details'><dl·class='xr-attrs'></dl></div></li></ul></div></div>" |
1140 | ························], | 1140 | ························], |
1141 | ························"text/plain":·[ | 1141 | ························"text/plain":·[ |
1142 | ····························"<xarray.DataArray·'tmin'·(month:·12,·location:·3)>\n", | 1142 | ····························"<xarray.DataArray·'tmin'·(month:·12,·location:·3)>\n", |
1143 | ····························"array([[0.9516129·,·0.88709677,·0.93548387],\n", | 1143 | ····························"array([[0.9516129·,·0.88709677,·0.93548387],\n", |
1144 | ····························"·······[0.84210526,·0.71929825,·0.77192982],\n", | 1144 | ····························"·······[0.84210526,·0.71929825,·0.77192982],\n", |
1145 | ····························"·······[0.24193548,·0.12903226,·0.16129032],\n", | 1145 | ····························"·······[0.24193548,·0.12903226,·0.16129032],\n", |
1146 | ····························"·······[0.········,·0.········,·0.········],\n", | 1146 | ····························"·······[0.········,·0.········,·0.········],\n", |
Offset 1760, 18 lines modified | Offset 1760, 18 lines modified | ||
1760 | ····························"Dimensions:·······(location:·3,·time:·731)\n", | 1760 | ····························"Dimensions:·······(location:·3,·time:·731)\n", |
1761 | ····························"Coordinates:\n", | 1761 | ····························"Coordinates:\n", |
1762 | ····························"··*·time··········(time)·datetime64[ns]·2000-01-01·2000-01-02·...·2001-12-31\n", | 1762 | ····························"··*·time··········(time)·datetime64[ns]·2000-01-01·2000-01-02·...·2001-12-31\n", |
1763 | ····························"··*·location······(location)·object·'IA'·'IN'·'IL'\n", | 1763 | ····························"··*·location······(location)·object·'IA'·'IN'·'IL'\n", |
1764 | ····························"····month·········(time)·int64·1·1·1·1·1·1·1·1·1·...·12·12·12·12·12·12·12·12·12\n", | 1764 | ····························"····month·········(time)·int64·1·1·1·1·1·1·1·1·1·...·12·12·12·12·12·12·12·12·12\n", |
1765 | ····························"Data·variables:\n", | 1765 | ····························"Data·variables:\n", |
1766 | ····························"····some_missing··(time,·location)·float64·nan·nan·nan·...·2.063·-1.346·-4.544\n", | 1766 | ····························"····some_missing··(time,·location)·float64·nan·nan·nan·...·2.063·-1.346·-4.544\n", |
1767 | ····························"····filled········(time,·location)·float64·-5.163·-4.216·...·-1.346·-4.544</pre><div·class='xr-wrap'·hidden><div·class='xr-header'><div·class='xr-obj-type'>xarray.Dataset</div></div><ul·class='xr-sections'><li·class='xr-section-item'><input·id='section- | 1767 | ····························"····filled········(time,·location)·float64·-5.163·-4.216·...·-1.346·-4.544</pre><div·class='xr-wrap'·hidden><div·class='xr-header'><div·class='xr-obj-type'>xarray.Dataset</div></div><ul·class='xr-sections'><li·class='xr-section-item'><input·id='section-956d458f-665d-4a7a-89e0-3e2a6a3e179b'·class='xr-section-summary-in'·type='checkbox'·disabled·><label·for='section-956d458f-665d-4a7a-89e0-3e2a6a3e179b'·class='xr-section-summary'··title='Expand/collapse·section'>Dimensions:</label><div·class='xr-section-in[·...·truncated·by·diffoscope;·len:·1235,·SHA:·3d08c1599adcb41208cfe7a376324c4e3e74d083e4459666f22daf1e1993e4c2·...·]'·title='Show/Hide·data·repr'><svg·class='icon·xr-icon-database'><use·xlink:href='#icon-database'></use></svg></label><div·class='xr-var-attrs'><dl·class='xr-attrs'></dl></div><div·class='xr-var-data'><pre>array(['2000-01-01T00:00:00.000000000',·'2000-01-02T00:00:00.000000000',\n", |
1768 | ····························"·······'2000-01-03T00:00:00.000000000',·...,·'2001-12-29T00:00:00.000000000',\n", | 1768 | ····························"·······'2000-01-03T00:00:00.000000000',·...,·'2001-12-29T00:00:00.000000000',\n", |
1769 | ····························"·······'2001-12-30T00:00:00.000000000',·'2001-12-31T00:00:00.000000000'],\n", | 1769 | ····························"·······'2001-12-30T00:00:00.000000000',·'2001-12-31T00:00:00.000000000'],\n", |
1770 | ····························"······dtype='datetime64[ns]')</pre></div></li><li·class='xr-var-item'><div·class='xr-var-name'><span·class='xr-has-index'>location</span></div><div·class='xr-var-dims'>(location)</div><div·class='xr-var-dtype'>object</div><div·class='xr-var-preview·xr-preview'>'IA'·'IN'·'IL'</div><input·id='attrs- | 1770 | ····························"······dtype='datetime64[ns]')</pre></div></li><li·class='xr-var-item'><div·class='xr-var-name'><span·class='xr-has-index'>location</span></div><div·class='xr-var-dims'>(location)</div><div·class='xr-var-dtype'>object</div><div·class='xr-var-preview·xr-preview'>'IA'·'IN'·'IL'</div><input·id='attrs-096a1be7-9f9c-4aed-94d7-04e999103ee4'·class='xr-var-attrs-in'·type='checkbox'·disabled><label·for='attrs-096a1be7-9f9c-4aed-94d7-04e999103ee4'·title='Show/Hide·attributes'><svg·class='icon·xr-icon-file-text2'><use·xlink:href='#icon-file-text2'></use></svg>[·...·truncated·by·diffoscope;·len:·1100,·SHA:·6e5fa43cfc6b1a2829e6f42661efb1c96bd5f0f1cf1ce5eaac7969040bda94a3·...·]'·title='Show/Hide·data·repr'><svg·class='icon·xr-icon-database'><use·xlink:href='#icon-database'></use></svg></label><div·class='xr-var-attrs'><dl·class='xr-attrs'></dl></div><div·class='xr-var-data'><pre>array([·1,··1,··1,··1,··1,··1,··1,··1,··1,··1,··1,··1,··1,··1,··1,··1,··1,\n", |
1771 | ····························"········1,··1,··1,··1,··1,··1,··1,··1,··1,··1,··1,··1,··1,··1,··2,··2,··2,\n", | 1771 | ····························"········1,··1,··1,··1,··1,··1,··1,··1,··1,··1,··1,··1,··1,··1,··2,··2,··2,\n", |
1772 | ····························"········2,··2,··2,··2,··2,··2,··2,··2,··2,··2,··2,··2,··2,··2,··2,··2,··2,\n", | 1772 | ····························"········2,··2,··2,··2,··2,··2,··2,··2,··2,··2,··2,··2,··2,··2,··2,··2,··2,\n", |
1773 | ····························"········2,··2,··2,··2,··2,··2,··2,··2,··2,··3,··3,··3,··3,··3,··3,··3,··3,\n", | 1773 | ····························"········2,··2,··2,··2,··2,··2,··2,··2,··2,··3,··3,··3,··3,··3,··3,··3,··3,\n", |
1774 | ····························"········3,··3,··3,··3,··3,··3,··3,··3,··3,··3,··3,··3,··3,··3,··3,··3,··3,\n", | 1774 | ····························"········3,··3,··3,··3,··3,··3,··3,··3,··3,··3,··3,··3,··3,··3,··3,··3,··3,\n", |
1775 | ····························"········3,··3,··3,··3,··3,··3,··4,··4,··4,··4,··4,··4,··4,··4,··4,··4,··4,\n", | 1775 | ····························"········3,··3,··3,··3,··3,··3,··4,··4,··4,··4,··4,··4,··4,··4,··4,··4,··4,\n", |
1776 | ····························"········4,··4,··4,··4,··4,··4,··4,··4,··4,··4,··4,··4,··4,··4,··4,··4,··4,\n", | 1776 | ····························"········4,··4,··4,··4,··4,··4,··4,··4,··4,··4,··4,··4,··4,··4,··4,··4,··4,\n", |
1777 | ····························"········4,··4,··5,··5,··5,··5,··5,··5,··5,··5,··5,··5,··5,··5,··5,··5,··5,\n", | 1777 | ····························"········4,··4,··5,··5,··5,··5,··5,··5,··5,··5,··5,··5,··5,··5,··5,··5,··5,\n", |
Offset 1803, 27 lines modified | Offset 1803, 27 lines modified | ||
1803 | ····························"········8,··8,··8,··8,··8,··8,··8,··8,··8,··8,··8,··8,··8,··8,··9,··9,··9,\n", | 1803 | ····························"········8,··8,··8,··8,··8,··8,··8,··8,··8,··8,··8,··8,··8,··8,··9,··9,··9,\n", |
1804 | ····························"········9,··9,··9,··9,··9,··9,··9,··9,··9,··9,··9,··9,··9,··9,··9,··9,··9,\n", | 1804 | ····························"········9,··9,··9,··9,··9,··9,··9,··9,··9,··9,··9,··9,··9,··9,··9,··9,··9,\n", |
1805 | ····························"········9,··9,··9,··9,··9,··9,··9,··9,··9,··9,·10,·10,·10,·10,·10,·10,·10,\n", | 1805 | ····························"········9,··9,··9,··9,··9,··9,··9,··9,··9,··9,·10,·10,·10,·10,·10,·10,·10,\n", |
1806 | ····························"·······10,·10,·10,·10,·10,·10,·10,·10,·10,·10,·10,·10,·10,·10,·10,·10,·10,\n", | 1806 | ····························"·······10,·10,·10,·10,·10,·10,·10,·10,·10,·10,·10,·10,·10,·10,·10,·10,·10,\n", |
1807 | ····························"·······10,·10,·10,·10,·10,·10,·10,·11,·11,·11,·11,·11,·11,·11,·11,·11,·11,\n", | 1807 | ····························"·······10,·10,·10,·10,·10,·10,·10,·11,·11,·11,·11,·11,·11,·11,·11,·11,·11,\n", |
1808 | ····························"·······11,·11,·11,·11,·11,·11,·11,·11,·11,·11,·11,·11,·11,·11,·11,·11,·11,\n", | 1808 | ····························"·······11,·11,·11,·11,·11,·11,·11,·11,·11,·11,·11,·11,·11,·11,·11,·11,·11,\n", |
1809 | ····························"·······11,·11,·11,·12,·12,·12,·12,·12,·12,·12,·12,·12,·12,·12,·12,·12,·12,\n", | 1809 | ····························"·······11,·11,·11,·12,·12,·12,·12,·12,·12,·12,·12,·12,·12,·12,·12,·12,·12,\n", |
1810 | ····························"·······12,·12,·12,·12,·12,·12,·12,·12,·12,·12,·12,·12,·12,·12,·12,·12,·12])</pre></div></li></ul></div></li><li·class='xr-section-item'><input·id='section- | 1810 | ····························"·······12,·12,·12,·12,·12,·12,·12,·12,·12,·12,·12,·12,·12,·12,·12,·12,·12])</pre></div></li></ul></div></li><li·class='xr-section-item'><input·id='section-bb363f93-6314-4da9-b770-6f04c797f033'·class='xr-section-summary-in'·type='checkbox'··checked><label·for='section-bb363f93-6314-4da9-b770-6f04c797f033'·class='xr-section-summary'·>Data·variables:·<span>(2)</span></label><div·class='xr-section-inline-details[·...·truncated·by·diffoscope;·len:·737,·SHA:·5c049520e93f8c1b813be97884339037d3df8784566cf45b449e5cfa0fd33f95·...·]'·title='Show/Hide·data·repr'><svg·class='icon·xr-icon-database'><use·xlink:href='#icon-database'></use></svg></label><div·class='xr-var-attrs'><dl·class='xr-attrs'></dl></div><div·class='xr-var-data'><pre>array([[·········nan,··········nan,··········nan],\n", |
1811 | ····························"·······[·········nan,··········nan,··········nan],\n", | 1811 | ····························"·······[·········nan,··········nan,··········nan],\n", |
1812 | ····························"·······[·········nan,··········nan,··········nan],\n", | 1812 | ····························"·······[·········nan,··········nan,··········nan],\n", |
1813 | ····························"·······...,\n", | 1813 | ····························"·······...,\n", |
1814 | ····························"·······[·-5.34723825,·-13.37459826,··-4.93221199],\n", | 1814 | ····························"·······[·-5.34723825,·-13.37459826,··-4.93221199],\n", |
1815 | ····························"·······[·-2.67283594,··-5.18072141,··-4.11567869],\n", | 1815 | ····························"·······[·-2.67283594,··-5.18072141,··-4.11567869],\n", |
1816 | ····························"·······[··2.06327582,··-1.34576404,··-4.54392729]])</pre></div></li><li·class='xr-var-item'><div·class='xr-var-name'><span>filled</span></div><div·class='xr-var-dims'>(time,·location)</div><div·class='xr-var-dtype'>float64</div><div·class='xr-var-preview·xr-preview'>-5.163·-4.216·...·-1.346·-4.544</div><input·id='attrs- | 1816 | ····························"·······[··2.06327582,··-1.34576404,··-4.54392729]])</pre></div></li><li·class='xr-var-item'><div·class='xr-var-name'><span>filled</span></div><div·class='xr-var-dims'>(time,·location)</div><div·class='xr-var-dtype'>float64</div><div·class='xr-var-preview·xr-preview'>-5.163·-4.216·...·-1.346·-4.544</div><input·id='attrs-f8d92454-61bb-4571-bd34-c1ca3e056519'·class='xr-var-attrs-in'·type='checkbox'·disabled><label·for='attrs-f8d92454-61bb-4571-bd34-c1ca3e056519'·title='Show/Hide·attributes'><svg·class='icon·xr-icon-file-text2'><use·xlink:href='#icon-file-text2'></use></svg>[·...·truncated·by·diffoscope;·len:·154,·SHA:·2b736be94199fe08e6ed62db515c65b038dad2c41e100936a049f79f2648bd0b·...·]'·title='Show/Hide·data·repr'><svg·class='icon·xr-icon-database'><use·xlink:href='#icon-database'></use></svg></label><div·class='xr-var-attrs'><dl·class='xr-attrs'></dl></div><div·class='xr-var-data'><pre>array([[·-5.16274935,··-4.21616663,··-4.68137385],\n", |
1817 | ····························"·······[·-5.16274935,··-4.21616663,··-4.68137385],\n", | 1817 | ····························"·······[·-5.16274935,··-4.21616663,··-4.68137385],\n", |
1818 | ····························"·······[·-5.16274935,··-4.21616663,··-4.68137385],\n", | 1818 | ····························"·······[·-5.16274935,··-4.21616663,··-4.68137385],\n", |
1819 | ····························"·······...,\n", | 1819 | ····························"·······...,\n", |
1820 | ····························"·······[·-5.34723825,·-13.37459826,··-4.93221199],\n", | 1820 | ····························"·······[·-5.34723825,·-13.37459826,··-4.93221199],\n", |
1821 | ····························"·······[·-2.67283594,··-5.18072141,··-4.11567869],\n", | 1821 | ····························"·······[·-2.67283594,··-5.18072141,··-4.11567869],\n", |
1822 | ····························"·······[··2.06327582,··-1.34576404,··-4.54392729]])</pre></div></li></ul></div></li><li·class='xr-section-item'><input·id='section- | 1822 | ····························"·······[··2.06327582,··-1.34576404,··-4.54392729]])</pre></div></li></ul></div></li><li·class='xr-section-item'><input·id='section-0496a124-c104-4ffb-a62e-4b13228c8166'·class='xr-section-summary-in'·type='checkbox'·disabled·><label·for='section-0496a124-c104-4ffb-a62e-4b13228c8166'·class='xr-section-summary'··title='Expand/collapse·section'>Attributes:·<span>(0)</span></label><div·class='xr-section-inline-details'></div><div·class='xr-section-details'><dl·class='xr-attrs'></dl></div></li></ul></div></div>" |
1823 | ························], | 1823 | ························], |
1824 | ························"text/plain":·[ | 1824 | ························"text/plain":·[ |
1825 | ····························"<xarray.Dataset>\n", | 1825 | ····························"<xarray.Dataset>\n", |
1826 | ····························"Dimensions:·······(location:·3,·time:·731)\n", | 1826 | ····························"Dimensions:·······(location:·3,·time:·731)\n", |
1827 | ····························"Coordinates:\n", | 1827 | ····························"Coordinates:\n", |
1828 | ····························"··*·time··········(time)·datetime64[ns]·2000-01-01·2000-01-02·...·2001-12-31\n", | 1828 | ····························"··*·time··········(time)·datetime64[ns]·2000-01-01·2000-01-02·...·2001-12-31\n", |
1829 | ····························"··*·location······(location)·object·'IA'·'IN'·'IL'\n", | 1829 | ····························"··*·location······(location)·object·'IA'·'IN'·'IL'\n", |
Offset 875, 15 lines modified | Offset 875, 15 lines modified | ||
875 | <span·class="nn">/build/reproducible-path/python-xarray-0.16.2/xarray/tutorial.py</span>·in·<span·class="ni">open_dataset</span><span·class="nt">(name,·cache,·cache_dir,·github_url,·branch,·**kws)</span> | 875 | <span·class="nn">/build/reproducible-path/python-xarray-0.16.2/xarray/tutorial.py</span>·in·<span·class="ni">open_dataset</span><span·class="nt">(name,·cache,·cache_dir,·github_url,·branch,·**kws)</span> |
876 | <span·class="g·g-Whitespace">·····</span><span·class="mi">76</span>·········<span·class="c1">#·May·want·to·add·an·option·to·remove·it.</span> | 876 | <span·class="g·g-Whitespace">·····</span><span·class="mi">76</span>·········<span·class="c1">#·May·want·to·add·an·option·to·remove·it.</span> |
877 | <span·class="g·g-Whitespace">·····</span><span·class="mi">77</span>·········<span·class="k">if</span>·<span·class="ow">not</span>·<span·class="n">_os</span><span·class="o">.</span><span·class="n">path</span><span·class="o">.</span><span·class="n">isdir</span><span·class="p">(</span><span·class="n">longdir</span><span·class="p">):</span> | 877 | <span·class="g·g-Whitespace">·····</span><span·class="mi">77</span>·········<span·class="k">if</span>·<span·class="ow">not</span>·<span·class="n">_os</span><span·class="o">.</span><span·class="n">path</span><span·class="o">.</span><span·class="n">isdir</span><span·class="p">(</span><span·class="n">longdir</span><span·class="p">):</span> |
878 | <span·class="ne">--->·</span><span·class="mi">78</span>·············<span·class="n">_os</span><span·class="o">.</span><span·class="n">mkdir</span><span·class="p">(</span><span·class="n">longdir</span><span·class="p">)</span> | 878 | <span·class="ne">--->·</span><span·class="mi">78</span>·············<span·class="n">_os</span><span·class="o">.</span><span·class="n">mkdir</span><span·class="p">(</span><span·class="n">longdir</span><span·class="p">)</span> |
879 | <span·class="g·g-Whitespace">·····</span><span·class="mi">79</span>· | 879 | <span·class="g·g-Whitespace">·····</span><span·class="mi">79</span>· |
880 | <span·class="g·g-Whitespace">·····</span><span·class="mi">80</span>·········<span·class="n">url</span>·<span·class="o">=</span>·<span·class="s2">"/"</span><span·class="o">.</span><span·class="n">join</span><span·class="p">((</span><span·class="n">github_url</span><span·class="p">,</span>·<span·class="s2">"raw"</span><span·class="p">,</span>·<span·class="n">branch</span><span·class="p">,</span>·<span·class="n">fullname</span><span·class="p">))</span> | 880 | <span·class="g·g-Whitespace">·····</span><span·class="mi">80</span>·········<span·class="n">url</span>·<span·class="o">=</span>·<span·class="s2">"/"</span><span·class="o">.</span><span·class="n">join</span><span·class="p">((</span><span·class="n">github_url</span><span·class="p">,</span>·<span·class="s2">"raw"</span><span·class="p">,</span>·<span·class="n">branch</span><span·class="p">,</span>·<span·class="n">fullname</span><span·class="p">))</span> |
881 | <span·class="ne">FileNotFoundError</span>:·[Errno·2]·No·such·file·or·directory:·'/nonexistent/ | 881 | <span·class="ne">FileNotFoundError</span>:·[Errno·2]·No·such·file·or·directory:·'/nonexistent/second-build/.xarray_tutorial_data' |
882 | <span·class="c1">#·add·an·empty·2D·dataarray</span> | 882 | <span·class="c1">#·add·an·empty·2D·dataarray</span> |
883 | <span·class="gp">In·[54]:·</span><span·class="n">ds</span><span·class="p">[</span><span·class="s2">"empty"</span><span·class="p">]</span>·<span·class="o">=</span>·<span·class="n">xr</span><span·class="o">.</span><span·class="n">full_like</span><span·class="p">(</span><span·class="n">ds</span><span·class="o">.</span><span·class="n">air</span><span·class="o">.</span><span·class="n">mean</span><span·class="p">(</span><span·class="s2">"time"</span><span·class="p">),</span>·<span·class="n">fill_value</span><span·class="o">=</span><span·class="mi">0</span><span·class="p">)</span> | 883 | <span·class="gp">In·[54]:·</span><span·class="n">ds</span><span·class="p">[</span><span·class="s2">"empty"</span><span·class="p">]</span>·<span·class="o">=</span>·<span·class="n">xr</span><span·class="o">.</span><span·class="n">full_like</span><span·class="p">(</span><span·class="n">ds</span><span·class="o">.</span><span·class="n">air</span><span·class="o">.</span><span·class="n">mean</span><span·class="p">(</span><span·class="s2">"time"</span><span·class="p">),</span>·<span·class="n">fill_value</span><span·class="o">=</span><span·class="mi">0</span><span·class="p">)</span> |
884 | <span·class="gt">---------------------------------------------------------------------------</span> | 884 | <span·class="gt">---------------------------------------------------------------------------</span> |
885 | <span·class="ne">AttributeError</span><span·class="g·g-Whitespace">····························</span>Traceback·(most·recent·call·last) | 885 | <span·class="ne">AttributeError</span><span·class="g·g-Whitespace">····························</span>Traceback·(most·recent·call·last) |
886 | <span·class="o"><</span><span·class="n">ipython</span><span·class="o">-</span><span·class="nb">input</span><span·class="o">-</span><span·class="mi">54</span><span·class="o">-</span><span·class="mi">6709</span><span·class="n">edaff03d</span><span·class="o">></span>·<span·class="ow">in</span>·<span·class="o"><</span><span·class="n">module</span><span·class="o">></span> | 886 | <span·class="o"><</span><span·class="n">ipython</span><span·class="o">-</span><span·class="nb">input</span><span·class="o">-</span><span·class="mi">54</span><span·class="o">-</span><span·class="mi">6709</span><span·class="n">edaff03d</span><span·class="o">></span>·<span·class="ow">in</span>·<span·class="o"><</span><span·class="n">module</span><span·class="o">></span> |
887 | <span·class="ne">---->·</span><span·class="mi">1</span>·<span·class="n">ds</span><span·class="p">[</span><span·class="s2">"empty"</span><span·class="p">]</span>·<span·class="o">=</span>·<span·class="n">xr</span><span·class="o">.</span><span·class="n">full_like</span><span·class="p">(</span><span·class="n">ds</span><span·class="o">.</span><span·class="n">air</span><span·class="o">.</span><span·class="n">mean</span><span·class="p">(</span><span·class="s2">"time"</span><span·class="p">),</span>·<span·class="n">fill_value</span><span·class="o">=</span><span·class="mi">0</span><span·class="p">)</span> | 887 | <span·class="ne">---->·</span><span·class="mi">1</span>·<span·class="n">ds</span><span·class="p">[</span><span·class="s2">"empty"</span><span·class="p">]</span>·<span·class="o">=</span>·<span·class="n">xr</span><span·class="o">.</span><span·class="n">full_like</span><span·class="p">(</span><span·class="n">ds</span><span·class="o">.</span><span·class="n">air</span><span·class="o">.</span><span·class="n">mean</span><span·class="p">(</span><span·class="s2">"time"</span><span·class="p">),</span>·<span·class="n">fill_value</span><span·class="o">=</span><span·class="mi">0</span><span·class="p">)</span> |
Offset 563, 15 lines modified | Offset 563, 15 lines modified | ||
563 | open_dataset(name,·cache,·cache_dir,·github_url,·branch,·**kws) | 563 | open_dataset(name,·cache,·cache_dir,·github_url,·branch,·**kws) |
564 | ·····76·········#·May·want·to·add·an·option·to·remove·it. | 564 | ·····76·········#·May·want·to·add·an·option·to·remove·it. |
565 | ·····77·········if·not·_os.path.isdir(longdir): | 565 | ·····77·········if·not·_os.path.isdir(longdir): |
566 | --->·78·············_os.mkdir(longdir) | 566 | --->·78·············_os.mkdir(longdir) |
567 | ·····79 | 567 | ·····79 |
568 | ·····80·········url·=·"/".join((github_url,·"raw",·branch,·fullname)) | 568 | ·····80·········url·=·"/".join((github_url,·"raw",·branch,·fullname)) |
569 | FileNotFoundError:·[Errno·2]·No·such·file·or·directory:·'/nonexistent/ | 569 | FileNotFoundError:·[Errno·2]·No·such·file·or·directory:·'/nonexistent/second- |
570 | build/.xarray_tutorial_data' | 570 | build/.xarray_tutorial_data' |
571 | #·add·an·empty·2D·dataarray | 571 | #·add·an·empty·2D·dataarray |
572 | In·[54]:·ds["empty"]·=·xr.full_like(ds.air.mean("time"),·fill_value=0) | 572 | In·[54]:·ds["empty"]·=·xr.full_like(ds.air.mean("time"),·fill_value=0) |
573 | --------------------------------------------------------------------------- | 573 | --------------------------------------------------------------------------- |
574 | AttributeError····························Traceback·(most·recent·call·last) | 574 | AttributeError····························Traceback·(most·recent·call·last) |
575 | <ipython-input-54-6709edaff03d>·in·<module> | 575 | <ipython-input-54-6709edaff03d>·in·<module> |
Offset 431, 18 lines modified | Offset 431, 18 lines modified | ||
431 | <span·class="nn">/build/reproducible-path/python-xarray-0.16.2/xarray/tutorial.py</span>·in·<span·class="ni">open_dataset</span><span·class="nt">(name,·cache,·cache_dir,·github_url,·branch,·**kws)</span> | 431 | <span·class="nn">/build/reproducible-path/python-xarray-0.16.2/xarray/tutorial.py</span>·in·<span·class="ni">open_dataset</span><span·class="nt">(name,·cache,·cache_dir,·github_url,·branch,·**kws)</span> |
432 | <span·class="g·g-Whitespace">·····</span><span·class="mi">76</span><span·class="s2">·········#·May·want·to·add·an·option·to·remove·it.</span> | 432 | <span·class="g·g-Whitespace">·····</span><span·class="mi">76</span><span·class="s2">·········#·May·want·to·add·an·option·to·remove·it.</span> |
433 | <span·class="g·g-Whitespace">·····</span><span·class="mi">77</span><span·class="s2">·········if·not·_os.path.isdir(longdir):</span> | 433 | <span·class="g·g-Whitespace">·····</span><span·class="mi">77</span><span·class="s2">·········if·not·_os.path.isdir(longdir):</span> |
434 | <span·class="ne">--->·</span><span·class="mi">78</span><span·class="s2">·············_os.mkdir(longdir)</span> | 434 | <span·class="ne">--->·</span><span·class="mi">78</span><span·class="s2">·············_os.mkdir(longdir)</span> |
435 | <span·class="g·g-Whitespace">·····</span><span·class="mi">79</span><span·class="s2">·</span> | 435 | <span·class="g·g-Whitespace">·····</span><span·class="mi">79</span><span·class="s2">·</span> |
436 | <span·class="g·g-Whitespace">·····</span><span·class="mi">80</span><span·class="s2">·········url·=·"/".join((github_url,·"raw",·branch,·fullname))</span> | 436 | <span·class="g·g-Whitespace">·····</span><span·class="mi">80</span><span·class="s2">·········url·=·"/".join((github_url,·"raw",·branch,·fullname))</span> |
437 | <span·class="ne">FileNotFoundError</span>:·[Errno·2]·No·such·file·or·directory:·'/nonexistent/ | 437 | <span·class="ne">FileNotFoundError</span>:·[Errno·2]·No·such·file·or·directory:·'/nonexistent/second-build/.xarray_tutorial_data' |
438 | <span·class="gp">In·[5]:·</span><span·class="n">ds</span><span·class="o">.</span><span·class="n">to_zarr</span><span·class="p">(</span><span·class="s2">"rasm.zarr"</span><span·class="p">,</span>·<span·class="n">mode</span><span·class="o">=</span><span·class="s2">"w"</span><span·class="p">)</span> | 438 | <span·class="gp">In·[5]:·</span><span·class="n">ds</span><span·class="o">.</span><span·class="n">to_zarr</span><span·class="p">(</span><span·class="s2">"rasm.zarr"</span><span·class="p">,</span>·<span·class="n">mode</span><span·class="o">=</span><span·class="s2">"w"</span><span·class="p">)</span> |
439 | <span·class="gh">Out[5]:·</span><span·class="go"><xarray.backends.zarr.ZarrStore·at·0xffff5 | 439 | <span·class="gh">Out[5]:·</span><span·class="go"><xarray.backends.zarr.ZarrStore·at·0xffff58045520></span> |
440 | <span·class="gp">In·[6]:·</span><span·class="kn">import</span>·<span·class="nn">zarr</span> | 440 | <span·class="gp">In·[6]:·</span><span·class="kn">import</span>·<span·class="nn">zarr</span> |
441 | <span·class="gp">In·[7]:·</span><span·class="n">zgroup</span>·<span·class="o">=</span>·<span·class="n">zarr</span><span·class="o">.</span><span·class="n">open</span><span·class="p">(</span><span·class="s2">"rasm.zarr"</span><span·class="p">)</span> | 441 | <span·class="gp">In·[7]:·</span><span·class="n">zgroup</span>·<span·class="o">=</span>·<span·class="n">zarr</span><span·class="o">.</span><span·class="n">open</span><span·class="p">(</span><span·class="s2">"rasm.zarr"</span><span·class="p">)</span> |
442 | <span·class="gp">In·[8]:·</span><span·class="nb">print</span><span·class="p">(</span><span·class="n">zgroup</span><span·class="o">.</span><span·class="n">tree</span><span·class="p">())</span> | 442 | <span·class="gp">In·[8]:·</span><span·class="nb">print</span><span·class="p">(</span><span·class="n">zgroup</span><span·class="o">.</span><span·class="n">tree</span><span·class="p">())</span> |
443 | <span·class="go">/</span> | 443 | <span·class="go">/</span> |
Offset 225, 19 lines modified | Offset 225, 19 lines modified | ||
225 | open_dataset(name,·cache,·cache_dir,·github_url,·branch,·**kws) | 225 | open_dataset(name,·cache,·cache_dir,·github_url,·branch,·**kws) |
226 | ·····76·········#·May·want·to·add·an·option·to·remove·it. | 226 | ·····76·········#·May·want·to·add·an·option·to·remove·it. |
227 | ·····77·········if·not·_os.path.isdir(longdir): | 227 | ·····77·········if·not·_os.path.isdir(longdir): |
228 | --->·78·············_os.mkdir(longdir) | 228 | --->·78·············_os.mkdir(longdir) |
229 | ·····79 | 229 | ·····79 |
230 | ·····80·········url·=·"/".join((github_url,·"raw",·branch,·fullname)) | 230 | ·····80·········url·=·"/".join((github_url,·"raw",·branch,·fullname)) |
231 | FileNotFoundError:·[Errno·2]·No·such·file·or·directory:·'/nonexistent/ | 231 | FileNotFoundError:·[Errno·2]·No·such·file·or·directory:·'/nonexistent/second- |
232 | build/.xarray_tutorial_data' | 232 | build/.xarray_tutorial_data' |
233 | In·[5]:·ds.to_zarr("rasm.zarr",·mode="w") | 233 | In·[5]:·ds.to_zarr("rasm.zarr",·mode="w") |
234 | Out[5]:·<xarray.backends.zarr.ZarrStore·at·0xffff5 | 234 | Out[5]:·<xarray.backends.zarr.ZarrStore·at·0xffff58045520> |
235 | In·[6]:·import·zarr | 235 | In·[6]:·import·zarr |
236 | In·[7]:·zgroup·=·zarr.open("rasm.zarr") | 236 | In·[7]:·zgroup·=·zarr.open("rasm.zarr") |
237 | In·[8]:·print(zgroup.tree()) | 237 | In·[8]:·print(zgroup.tree()) |
238 | / | 238 | / |
Offset 408, 24 lines modified | Offset 408, 24 lines modified | ||
408 | <span·class="gp">···....:·</span>····<span·class="n">np</span><span·class="o">.</span><span·class="n">sin</span><span·class="p">(</span><span·class="n">np</span><span·class="o">.</span><span·class="n">linspace</span><span·class="p">(</span><span·class="mi">0</span><span·class="p">,</span>·<span·class="mi">2</span>·<span·class="o">*</span>·<span·class="n">np</span><span·class="o">.</span><span·class="n">pi</span><span·class="p">,</span>·<span·class="mi">10</span><span·class="p">)),</span> | 408 | <span·class="gp">···....:·</span>····<span·class="n">np</span><span·class="o">.</span><span·class="n">sin</span><span·class="p">(</span><span·class="n">np</span><span·class="o">.</span><span·class="n">linspace</span><span·class="p">(</span><span·class="mi">0</span><span·class="p">,</span>·<span·class="mi">2</span>·<span·class="o">*</span>·<span·class="n">np</span><span·class="o">.</span><span·class="n">pi</span><span·class="p">,</span>·<span·class="mi">10</span><span·class="p">)),</span> |
409 | <span·class="gp">···....:·</span>····<span·class="n">dims</span><span·class="o">=</span><span·class="s2">"x"</span><span·class="p">,</span> | 409 | <span·class="gp">···....:·</span>····<span·class="n">dims</span><span·class="o">=</span><span·class="s2">"x"</span><span·class="p">,</span> |
410 | <span·class="gp">···....:·</span>····<span·class="n">coords</span><span·class="o">=</span><span·class="p">{</span><span·class="s2">"x"</span><span·class="p">:</span>·<span·class="n">np</span><span·class="o">.</span><span·class="n">linspace</span><span·class="p">(</span><span·class="mi">0</span><span·class="p">,</span>·<span·class="mi">1</span><span·class="p">,</span>·<span·class="mi">10</span><span·class="p">)},</span> | 410 | <span·class="gp">···....:·</span>····<span·class="n">coords</span><span·class="o">=</span><span·class="p">{</span><span·class="s2">"x"</span><span·class="p">:</span>·<span·class="n">np</span><span·class="o">.</span><span·class="n">linspace</span><span·class="p">(</span><span·class="mi">0</span><span·class="p">,</span>·<span·class="mi">1</span><span·class="p">,</span>·<span·class="mi">10</span><span·class="p">)},</span> |
411 | <span·class="gp">···....:·</span><span·class="p">)</span> | 411 | <span·class="gp">···....:·</span><span·class="p">)</span> |
412 | <span·class="gp">···....:·</span> | 412 | <span·class="gp">···....:·</span> |
413 | <span·class="gp">In·[17]:·</span><span·class="n">da</span><span·class="o">.</span><span·class="n">plot</span><span·class="o">.</span><span·class="n">line</span><span·class="p">(</span><span·class="s2">"o"</span><span·class="p">,</span>·<span·class="n">label</span><span·class="o">=</span><span·class="s2">"original"</span><span·class="p">)</span> | 413 | <span·class="gp">In·[17]:·</span><span·class="n">da</span><span·class="o">.</span><span·class="n">plot</span><span·class="o">.</span><span·class="n">line</span><span·class="p">(</span><span·class="s2">"o"</span><span·class="p">,</span>·<span·class="n">label</span><span·class="o">=</span><span·class="s2">"original"</span><span·class="p">)</span> |
414 | <span·class="gh">Out[17]:·</span><span·class="go">[<matplotlib.lines.Line2D·at·0xffff | 414 | <span·class="gh">Out[17]:·</span><span·class="go">[<matplotlib.lines.Line2D·at·0xffff4077d280>]</span> |
415 | <span·class="gp">In·[18]:·</span><span·class="n">da</span><span·class="o">.</span><span·class="n">interp</span><span·class="p">(</span><span·class="n">x</span><span·class="o">=</span><span·class="n">np</span><span·class="o">.</span><span·class="n">linspace</span><span·class="p">(</span><span·class="mi">0</span><span·class="p">,</span>·<span·class="mi">1</span><span·class="p">,</span>·<span·class="mi">100</span><span·class="p">))</span><span·class="o">.</span><span·class="n">plot</span><span·class="o">.</span><span·class="n">line</span><span·class="p">(</span><span·class="n">label</span><span·class="o">=</span><span·class="s2">"linear·(default)"</span><span·class="p">)</span> | 415 | <span·class="gp">In·[18]:·</span><span·class="n">da</span><span·class="o">.</span><span·class="n">interp</span><span·class="p">(</span><span·class="n">x</span><span·class="o">=</span><span·class="n">np</span><span·class="o">.</span><span·class="n">linspace</span><span·class="p">(</span><span·class="mi">0</span><span·class="p">,</span>·<span·class="mi">1</span><span·class="p">,</span>·<span·class="mi">100</span><span·class="p">))</span><span·class="o">.</span><span·class="n">plot</span><span·class="o">.</span><span·class="n">line</span><span·class="p">(</span><span·class="n">label</span><span·class="o">=</span><span·class="s2">"linear·(default)"</span><span·class="p">)</span> |
416 | <span·class="gh">Out[18]:·</span><span·class="go">[<matplotlib.lines.Line2D·at·0xffff | 416 | <span·class="gh">Out[18]:·</span><span·class="go">[<matplotlib.lines.Line2D·at·0xffff40798400>]</span> |
417 | <span·class="gp">In·[19]:·</span><span·class="n">da</span><span·class="o">.</span><span·class="n">interp</span><span·class="p">(</span><span·class="n">x</span><span·class="o">=</span><span·class="n">np</span><span·class="o">.</span><span·class="n">linspace</span><span·class="p">(</span><span·class="mi">0</span><span·class="p">,</span>·<span·class="mi">1</span><span·class="p">,</span>·<span·class="mi">100</span><span·class="p">),</span>·<span·class="n">method</span><span·class="o">=</span><span·class="s2">"cubic"</span><span·class="p">)</span><span·class="o">.</span><span·class="n">plot</span><span·class="o">.</span><span·class="n">line</span><span·class="p">(</span><span·class="n">label</span><span·class="o">=</span><span·class="s2">"cubic"</span><span·class="p">)</span> | 417 | <span·class="gp">In·[19]:·</span><span·class="n">da</span><span·class="o">.</span><span·class="n">interp</span><span·class="p">(</span><span·class="n">x</span><span·class="o">=</span><span·class="n">np</span><span·class="o">.</span><span·class="n">linspace</span><span·class="p">(</span><span·class="mi">0</span><span·class="p">,</span>·<span·class="mi">1</span><span·class="p">,</span>·<span·class="mi">100</span><span·class="p">),</span>·<span·class="n">method</span><span·class="o">=</span><span·class="s2">"cubic"</span><span·class="p">)</span><span·class="o">.</span><span·class="n">plot</span><span·class="o">.</span><span·class="n">line</span><span·class="p">(</span><span·class="n">label</span><span·class="o">=</span><span·class="s2">"cubic"</span><span·class="p">)</span> |
418 | <span·class="gh">Out[19]:·</span><span·class="go">[<matplotlib.lines.Line2D·at·0xffff | 418 | <span·class="gh">Out[19]:·</span><span·class="go">[<matplotlib.lines.Line2D·at·0xffff407980a0>]</span> |
419 | <span·class="gp">In·[20]:·</span><span·class="n">plt</span><span·class="o">.</span><span·class="n">legend</span><span·class="p">()</span> | 419 | <span·class="gp">In·[20]:·</span><span·class="n">plt</span><span·class="o">.</span><span·class="n">legend</span><span·class="p">()</span> |
420 | <span·class="gh">Out[20]:·</span><span·class="go"><matplotlib.legend.Legend·at·0xffff | 420 | <span·class="gh">Out[20]:·</span><span·class="go"><matplotlib.legend.Legend·at·0xffff40782490></span> |
421 | </pre></div> | 421 | </pre></div> |
422 | </div> | 422 | </div> |
423 | <a·class="reference·internal·image-reference"·href="_images/interpolation_sample1.png"><img·alt="_images/interpolation_sample1.png"·src="_images/interpolation_sample1.png"·style="width:·4in;"·/></a> | 423 | <a·class="reference·internal·image-reference"·href="_images/interpolation_sample1.png"><img·alt="_images/interpolation_sample1.png"·src="_images/interpolation_sample1.png"·style="width:·4in;"·/></a> |
424 | <p>Additional·keyword·arguments·can·be·passed·to·scipy’s·functions.</p> | 424 | <p>Additional·keyword·arguments·can·be·passed·to·scipy’s·functions.</p> |
425 | <div·class="highlight-ipython·notranslate"><div·class="highlight"><pre><span></span><span·class="go">#·fill·0·for·the·outside·of·the·original·coordinates.</span> | 425 | <div·class="highlight-ipython·notranslate"><div·class="highlight"><pre><span></span><span·class="go">#·fill·0·for·the·outside·of·the·original·coordinates.</span> |
426 | <span·class="gp">In·[21]:·</span><span·class="n">da</span><span·class="o">.</span><span·class="n">interp</span><span·class="p">(</span><span·class="n">x</span><span·class="o">=</span><span·class="n">np</span><span·class="o">.</span><span·class="n">linspace</span><span·class="p">(</span><span·class="o">-</span><span·class="mf">0.5</span><span·class="p">,</span>·<span·class="mf">1.5</span><span·class="p">,</span>·<span·class="mi">10</span><span·class="p">),</span>·<span·class="n">kwargs</span><span·class="o">=</span><span·class="p">{</span><span·class="s2">"fill_value"</span><span·class="p">:</span>·<span·class="mf">0.0</span><span·class="p">})</span> | 426 | <span·class="gp">In·[21]:·</span><span·class="n">da</span><span·class="o">.</span><span·class="n">interp</span><span·class="p">(</span><span·class="n">x</span><span·class="o">=</span><span·class="n">np</span><span·class="o">.</span><span·class="n">linspace</span><span·class="p">(</span><span·class="o">-</span><span·class="mf">0.5</span><span·class="p">,</span>·<span·class="mf">1.5</span><span·class="p">,</span>·<span·class="mi">10</span><span·class="p">),</span>·<span·class="n">kwargs</span><span·class="o">=</span><span·class="p">{</span><span·class="s2">"fill_value"</span><span·class="p">:</span>·<span·class="mf">0.0</span><span·class="p">})</span> |
427 | <span·class="gh">Out[21]:·</span><span·class="go"></span> | 427 | <span·class="gh">Out[21]:·</span><span·class="go"></span> |
Offset 611, 15 lines modified | Offset 611, 15 lines modified | ||
611 | <span·class="nn">/build/reproducible-path/python-xarray-0.16.2/xarray/tutorial.py</span>·in·<span·class="ni">open_dataset</span><span·class="nt">(name,·cache,·cache_dir,·github_url,·branch,·**kws)</span> | 611 | <span·class="nn">/build/reproducible-path/python-xarray-0.16.2/xarray/tutorial.py</span>·in·<span·class="ni">open_dataset</span><span·class="nt">(name,·cache,·cache_dir,·github_url,·branch,·**kws)</span> |
612 | <span·class="g·g-Whitespace">·····</span><span·class="mi">76</span>·········<span·class="c1">#·May·want·to·add·an·option·to·remove·it.</span> | 612 | <span·class="g·g-Whitespace">·····</span><span·class="mi">76</span>·········<span·class="c1">#·May·want·to·add·an·option·to·remove·it.</span> |
613 | <span·class="g·g-Whitespace">·····</span><span·class="mi">77</span>·········<span·class="k">if</span>·<span·class="ow">not</span>·<span·class="n">_os</span><span·class="o">.</span><span·class="n">path</span><span·class="o">.</span><span·class="n">isdir</span><span·class="p">(</span><span·class="n">longdir</span><span·class="p">):</span> | 613 | <span·class="g·g-Whitespace">·····</span><span·class="mi">77</span>·········<span·class="k">if</span>·<span·class="ow">not</span>·<span·class="n">_os</span><span·class="o">.</span><span·class="n">path</span><span·class="o">.</span><span·class="n">isdir</span><span·class="p">(</span><span·class="n">longdir</span><span·class="p">):</span> |
614 | <span·class="ne">--->·</span><span·class="mi">78</span>·············<span·class="n">_os</span><span·class="o">.</span><span·class="n">mkdir</span><span·class="p">(</span><span·class="n">longdir</span><span·class="p">)</span> | 614 | <span·class="ne">--->·</span><span·class="mi">78</span>·············<span·class="n">_os</span><span·class="o">.</span><span·class="n">mkdir</span><span·class="p">(</span><span·class="n">longdir</span><span·class="p">)</span> |
615 | <span·class="g·g-Whitespace">·····</span><span·class="mi">79</span>· | 615 | <span·class="g·g-Whitespace">·····</span><span·class="mi">79</span>· |
616 | <span·class="g·g-Whitespace">·····</span><span·class="mi">80</span>·········<span·class="n">url</span>·<span·class="o">=</span>·<span·class="s2">"/"</span><span·class="o">.</span><span·class="n">join</span><span·class="p">((</span><span·class="n">github_url</span><span·class="p">,</span>·<span·class="s2">"raw"</span><span·class="p">,</span>·<span·class="n">branch</span><span·class="p">,</span>·<span·class="n">fullname</span><span·class="p">))</span> | 616 | <span·class="g·g-Whitespace">·····</span><span·class="mi">80</span>·········<span·class="n">url</span>·<span·class="o">=</span>·<span·class="s2">"/"</span><span·class="o">.</span><span·class="n">join</span><span·class="p">((</span><span·class="n">github_url</span><span·class="p">,</span>·<span·class="s2">"raw"</span><span·class="p">,</span>·<span·class="n">branch</span><span·class="p">,</span>·<span·class="n">fullname</span><span·class="p">))</span> |
617 | <span·class="ne">FileNotFoundError</span>:·[Errno·2]·No·such·file·or·directory:·'/nonexistent/ | 617 | <span·class="ne">FileNotFoundError</span>:·[Errno·2]·No·such·file·or·directory:·'/nonexistent/second-build/.xarray_tutorial_data' |
618 | <span·class="gp">In·[45]:·</span><span·class="n">fig</span><span·class="p">,</span>·<span·class="n">axes</span>·<span·class="o">=</span>·<span·class="n">plt</span><span·class="o">.</span><span·class="n">subplots</span><span·class="p">(</span><span·class="n">ncols</span><span·class="o">=</span><span·class="mi">2</span><span·class="p">,</span>·<span·class="n">figsize</span><span·class="o">=</span><span·class="p">(</span><span·class="mi">10</span><span·class="p">,</span>·<span·class="mi">4</span><span·class="p">))</span> | 618 | <span·class="gp">In·[45]:·</span><span·class="n">fig</span><span·class="p">,</span>·<span·class="n">axes</span>·<span·class="o">=</span>·<span·class="n">plt</span><span·class="o">.</span><span·class="n">subplots</span><span·class="p">(</span><span·class="n">ncols</span><span·class="o">=</span><span·class="mi">2</span><span·class="p">,</span>·<span·class="n">figsize</span><span·class="o">=</span><span·class="p">(</span><span·class="mi">10</span><span·class="p">,</span>·<span·class="mi">4</span><span·class="p">))</span> |
619 | <span·class="gp">In·[46]:·</span><span·class="n">ds</span><span·class="o">.</span><span·class="n">air</span><span·class="o">.</span><span·class="n">plot</span><span·class="p">(</span><span·class="n">ax</span><span·class="o">=</span><span·class="n">axes</span><span·class="p">[</span><span·class="mi">0</span><span·class="p">])</span> | 619 | <span·class="gp">In·[46]:·</span><span·class="n">ds</span><span·class="o">.</span><span·class="n">air</span><span·class="o">.</span><span·class="n">plot</span><span·class="p">(</span><span·class="n">ax</span><span·class="o">=</span><span·class="n">axes</span><span·class="p">[</span><span·class="mi">0</span><span·class="p">])</span> |
620 | <span·class="gt">---------------------------------------------------------------------------</span> | 620 | <span·class="gt">---------------------------------------------------------------------------</span> |
621 | <span·class="ne">AttributeError</span><span·class="g·g-Whitespace">····························</span>Traceback·(most·recent·call·last) | 621 | <span·class="ne">AttributeError</span><span·class="g·g-Whitespace">····························</span>Traceback·(most·recent·call·last) |
622 | <span·class="o"><</span><span·class="n">ipython</span><span·class="o">-</span><span·class="nb">input</span><span·class="o">-</span><span·class="mi">46</span><span·class="o">-</span><span·class="n">cb8f083667be</span><span·class="o">></span>·<span·class="ow">in</span>·<span·class="o"><</span><span·class="n">module</span><span·class="o">></span> | 622 | <span·class="o"><</span><span·class="n">ipython</span><span·class="o">-</span><span·class="nb">input</span><span·class="o">-</span><span·class="mi">46</span><span·class="o">-</span><span·class="n">cb8f083667be</span><span·class="o">></span>·<span·class="ow">in</span>·<span·class="o"><</span><span·class="n">module</span><span·class="o">></span> |
Offset 202, 26 lines modified | Offset 202, 26 lines modified | ||
202 | ···....:·····np.sin(np.linspace(0,·2·*·np.pi,·10)), | 202 | ···....:·····np.sin(np.linspace(0,·2·*·np.pi,·10)), |
203 | ···....:·····dims="x", | 203 | ···....:·····dims="x", |
204 | ···....:·····coords={"x":·np.linspace(0,·1,·10)}, | 204 | ···....:·····coords={"x":·np.linspace(0,·1,·10)}, |
205 | ···....:·) | 205 | ···....:·) |
206 | ···....: | 206 | ···....: |
207 | In·[17]:·da.plot.line("o",·label="original") | 207 | In·[17]:·da.plot.line("o",·label="original") |
208 | Out[17]:·[<matplotlib.lines.Line2D·at·0xffff | 208 | Out[17]:·[<matplotlib.lines.Line2D·at·0xffff4077d280>] |
209 | In·[18]:·da.interp(x=np.linspace(0,·1,·100)).plot.line(label="linear | 209 | In·[18]:·da.interp(x=np.linspace(0,·1,·100)).plot.line(label="linear |
210 | (default)") | 210 | (default)") |
211 | Out[18]:·[<matplotlib.lines.Line2D·at·0xffff | 211 | Out[18]:·[<matplotlib.lines.Line2D·at·0xffff40798400>] |
212 | In·[19]:·da.interp(x=np.linspace(0,·1,·100),·method="cubic").plot.line | 212 | In·[19]:·da.interp(x=np.linspace(0,·1,·100),·method="cubic").plot.line |
213 | (label="cubic") | 213 | (label="cubic") |
214 | Out[19]:·[<matplotlib.lines.Line2D·at·0xffff | 214 | Out[19]:·[<matplotlib.lines.Line2D·at·0xffff407980a0>] |
215 | In·[20]:·plt.legend() | 215 | In·[20]:·plt.legend() |
216 | Out[20]:·<matplotlib.legend.Legend·at·0xffff | 216 | Out[20]:·<matplotlib.legend.Legend·at·0xffff40782490> |
217 | [_images/interpolation_sample1.png] | 217 | [_images/interpolation_sample1.png] |
218 | Additional·keyword·arguments·can·be·passed·to·scipyâs·functions. | 218 | Additional·keyword·arguments·can·be·passed·to·scipyâs·functions. |
219 | #·fill·0·for·the·outside·of·the·original·coordinates. | 219 | #·fill·0·for·the·outside·of·the·original·coordinates. |
220 | In·[21]:·da.interp(x=np.linspace(-0.5,·1.5,·10),·kwargs={"fill_value":·0.0}) | 220 | In·[21]:·da.interp(x=np.linspace(-0.5,·1.5,·10),·kwargs={"fill_value":·0.0}) |
221 | Out[21]: | 221 | Out[21]: |
222 | <xarray.DataArray·(x:·10)> | 222 | <xarray.DataArray·(x:·10)> |
223 | array([·0.···,··0.···,··0.···,··0.814,··0.604,·-0.604,·-0.814,··0.···,··0.···, | 223 | array([·0.···,··0.···,··0.···,··0.814,··0.604,·-0.604,·-0.814,··0.···,··0.···, |
Offset 390, 15 lines modified | Offset 390, 15 lines modified | ||
390 | open_dataset(name,·cache,·cache_dir,·github_url,·branch,·**kws) | 390 | open_dataset(name,·cache,·cache_dir,·github_url,·branch,·**kws) |
391 | ·····76·········#·May·want·to·add·an·option·to·remove·it. | 391 | ·····76·········#·May·want·to·add·an·option·to·remove·it. |
392 | ·····77·········if·not·_os.path.isdir(longdir): | 392 | ·····77·········if·not·_os.path.isdir(longdir): |
393 | --->·78·············_os.mkdir(longdir) | 393 | --->·78·············_os.mkdir(longdir) |
394 | ·····79 | 394 | ·····79 |
395 | ·····80·········url·=·"/".join((github_url,·"raw",·branch,·fullname)) | 395 | ·····80·········url·=·"/".join((github_url,·"raw",·branch,·fullname)) |
396 | FileNotFoundError:·[Errno·2]·No·such·file·or·directory:·'/nonexistent/ | 396 | FileNotFoundError:·[Errno·2]·No·such·file·or·directory:·'/nonexistent/second- |
397 | build/.xarray_tutorial_data' | 397 | build/.xarray_tutorial_data' |
398 | In·[45]:·fig,·axes·=·plt.subplots(ncols=2,·figsize=(10,·4)) | 398 | In·[45]:·fig,·axes·=·plt.subplots(ncols=2,·figsize=(10,·4)) |
399 | In·[46]:·ds.air.plot(ax=axes[0]) | 399 | In·[46]:·ds.air.plot(ax=axes[0]) |
400 | --------------------------------------------------------------------------- | 400 | --------------------------------------------------------------------------- |
401 | AttributeError····························Traceback·(most·recent·call·last) | 401 | AttributeError····························Traceback·(most·recent·call·last) |
Offset 1059, 15 lines modified | Offset 1059, 15 lines modified | ||
1059 | <span·class="gp">···....:·</span>········<span·class="s2">"y"</span><span·class="p">:</span>·<span·class="n">pd</span><span·class="o">.</span><span·class="n">date_range</span><span·class="p">(</span><span·class="s2">"2000-01-01"</span><span·class="p">,</span>·<span·class="n">periods</span><span·class="o">=</span><span·class="mi">5</span><span·class="p">),</span> | 1059 | <span·class="gp">···....:·</span>········<span·class="s2">"y"</span><span·class="p">:</span>·<span·class="n">pd</span><span·class="o">.</span><span·class="n">date_range</span><span·class="p">(</span><span·class="s2">"2000-01-01"</span><span·class="p">,</span>·<span·class="n">periods</span><span·class="o">=</span><span·class="mi">5</span><span·class="p">),</span> |
1060 | <span·class="gp">···....:·</span>········<span·class="s2">"z"</span><span·class="p">:</span>·<span·class="p">(</span><span·class="s2">"x"</span><span·class="p">,</span>·<span·class="nb">list</span><span·class="p">(</span><span·class="s2">"abcd"</span><span·class="p">)),</span> | 1060 | <span·class="gp">···....:·</span>········<span·class="s2">"z"</span><span·class="p">:</span>·<span·class="p">(</span><span·class="s2">"x"</span><span·class="p">,</span>·<span·class="nb">list</span><span·class="p">(</span><span·class="s2">"abcd"</span><span·class="p">)),</span> |
1061 | <span·class="gp">···....:·</span>····<span·class="p">},</span> | 1061 | <span·class="gp">···....:·</span>····<span·class="p">},</span> |
1062 | <span·class="gp">···....:·</span><span·class="p">)</span> | 1062 | <span·class="gp">···....:·</span><span·class="p">)</span> |
1063 | <span·class="gp">···....:·</span> | 1063 | <span·class="gp">···....:·</span> |
1064 | <span·class="gp">In·[39]:·</span><span·class="n">ds</span><span·class="o">.</span><span·class="n">to_zarr</span><span·class="p">(</span><span·class="s2">"path/to/directory.zarr"</span><span·class="p">)</span> | 1064 | <span·class="gp">In·[39]:·</span><span·class="n">ds</span><span·class="o">.</span><span·class="n">to_zarr</span><span·class="p">(</span><span·class="s2">"path/to/directory.zarr"</span><span·class="p">)</span> |
1065 | <span·class="gh">Out[39]:·</span><span·class="go"><xarray.backends.zarr.ZarrStore·at·0xffff | 1065 | <span·class="gh">Out[39]:·</span><span·class="go"><xarray.backends.zarr.ZarrStore·at·0xffff4074e1c0></span> |
1066 | </pre></div> | 1066 | </pre></div> |
1067 | </div> | 1067 | </div> |
1068 | <p>(The·suffix·<code·class="docutils·literal·notranslate"><span·class="pre">.zarr</span></code>·is·optional–just·a·reminder·that·a·zarr·store·lives | 1068 | <p>(The·suffix·<code·class="docutils·literal·notranslate"><span·class="pre">.zarr</span></code>·is·optional–just·a·reminder·that·a·zarr·store·lives |
1069 | there.)·If·the·directory·does·not·exist,·it·will·be·created.·If·a·zarr | 1069 | there.)·If·the·directory·does·not·exist,·it·will·be·created.·If·a·zarr |
1070 | store·is·already·present·at·that·path,·an·error·will·be·raised,·preventing·it | 1070 | store·is·already·present·at·that·path,·an·error·will·be·raised,·preventing·it |
1071 | from·being·overwritten.·To·override·this·behavior·and·overwrite·an·existing | 1071 | from·being·overwritten.·To·override·this·behavior·and·overwrite·an·existing |
1072 | store,·add·<code·class="docutils·literal·notranslate"><span·class="pre">mode='w'</span></code>·when·invoking·<code·class="xref·py·py-meth·docutils·literal·notranslate"><span·class="pre">to_zarr()</span></code>.</p> | 1072 | store,·add·<code·class="docutils·literal·notranslate"><span·class="pre">mode='w'</span></code>·when·invoking·<code·class="xref·py·py-meth·docutils·literal·notranslate"><span·class="pre">to_zarr()</span></code>.</p> |
Offset 1113, 15 lines modified | Offset 1113, 15 lines modified | ||
1113 | These·options·can·be·passed·to·the·<code·class="docutils·literal·notranslate"><span·class="pre">to_zarr</span></code>·method·as·variable·encoding. | 1113 | These·options·can·be·passed·to·the·<code·class="docutils·literal·notranslate"><span·class="pre">to_zarr</span></code>·method·as·variable·encoding. |
1114 | For·example:</p> | 1114 | For·example:</p> |
1115 | <div·class="highlight-ipython·notranslate"><div·class="highlight"><pre><span></span><span·class="gp">In·[42]:·</span><span·class="kn">import</span>·<span·class="nn">zarr</span> | 1115 | <div·class="highlight-ipython·notranslate"><div·class="highlight"><pre><span></span><span·class="gp">In·[42]:·</span><span·class="kn">import</span>·<span·class="nn">zarr</span> |
1116 | <span·class="gp">In·[43]:·</span><span·class="n">compressor</span>·<span·class="o">=</span>·<span·class="n">zarr</span><span·class="o">.</span><span·class="n">Blosc</span><span·class="p">(</span><span·class="n">cname</span><span·class="o">=</span><span·class="s2">"zstd"</span><span·class="p">,</span>·<span·class="n">clevel</span><span·class="o">=</span><span·class="mi">3</span><span·class="p">,</span>·<span·class="n">shuffle</span><span·class="o">=</span><span·class="mi">2</span><span·class="p">)</span> | 1116 | <span·class="gp">In·[43]:·</span><span·class="n">compressor</span>·<span·class="o">=</span>·<span·class="n">zarr</span><span·class="o">.</span><span·class="n">Blosc</span><span·class="p">(</span><span·class="n">cname</span><span·class="o">=</span><span·class="s2">"zstd"</span><span·class="p">,</span>·<span·class="n">clevel</span><span·class="o">=</span><span·class="mi">3</span><span·class="p">,</span>·<span·class="n">shuffle</span><span·class="o">=</span><span·class="mi">2</span><span·class="p">)</span> |
1117 | <span·class="gp">In·[44]:·</span><span·class="n">ds</span><span·class="o">.</span><span·class="n">to_zarr</span><span·class="p">(</span><span·class="s2">"foo.zarr"</span><span·class="p">,</span>·<span·class="n">encoding</span><span·class="o">=</span><span·class="p">{</span><span·class="s2">"foo"</span><span·class="p">:</span>·<span·class="p">{</span><span·class="s2">"compressor"</span><span·class="p">:</span>·<span·class="n">compressor</span><span·class="p">}})</span> | 1117 | <span·class="gp">In·[44]:·</span><span·class="n">ds</span><span·class="o">.</span><span·class="n">to_zarr</span><span·class="p">(</span><span·class="s2">"foo.zarr"</span><span·class="p">,</span>·<span·class="n">encoding</span><span·class="o">=</span><span·class="p">{</span><span·class="s2">"foo"</span><span·class="p">:</span>·<span·class="p">{</span><span·class="s2">"compressor"</span><span·class="p">:</span>·<span·class="n">compressor</span><span·class="p">}})</span> |
1118 | <span·class="gh">Out[44]:·</span><span·class="go"><xarray.backends.zarr.ZarrStore·at·0xffff | 1118 | <span·class="gh">Out[44]:·</span><span·class="go"><xarray.backends.zarr.ZarrStore·at·0xffff4074e520></span> |
1119 | </pre></div> | 1119 | </pre></div> |
1120 | </div> | 1120 | </div> |
1121 | <div·class="admonition·note"> | 1121 | <div·class="admonition·note"> |
1122 | <p·class="admonition-title">Note</p> | 1122 | <p·class="admonition-title">Note</p> |
1123 | <p>Not·all·native·zarr·compression·and·filtering·options·have·been·tested·with | 1123 | <p>Not·all·native·zarr·compression·and·filtering·options·have·been·tested·with |
1124 | xarray.</p> | 1124 | xarray.</p> |
1125 | </div> | 1125 | </div> |
Offset 1182, 28 lines modified | Offset 1182, 28 lines modified | ||
1182 | <span·class="gp">···....:·</span>········<span·class="s2">"y"</span><span·class="p">:</span>·<span·class="p">[</span><span·class="mi">1</span><span·class="p">,</span>·<span·class="mi">2</span><span·class="p">,</span>·<span·class="mi">3</span><span·class="p">,</span>·<span·class="mi">4</span><span·class="p">,</span>·<span·class="mi">5</span><span·class="p">],</span> | 1182 | <span·class="gp">···....:·</span>········<span·class="s2">"y"</span><span·class="p">:</span>·<span·class="p">[</span><span·class="mi">1</span><span·class="p">,</span>·<span·class="mi">2</span><span·class="p">,</span>·<span·class="mi">3</span><span·class="p">,</span>·<span·class="mi">4</span><span·class="p">,</span>·<span·class="mi">5</span><span·class="p">],</span> |
1183 | <span·class="gp">···....:·</span>········<span·class="s2">"t"</span><span·class="p">:</span>·<span·class="n">pd</span><span·class="o">.</span><span·class="n">date_range</span><span·class="p">(</span><span·class="s2">"2001-01-01"</span><span·class="p">,</span>·<span·class="n">periods</span><span·class="o">=</span><span·class="mi">2</span><span·class="p">),</span> | 1183 | <span·class="gp">···....:·</span>········<span·class="s2">"t"</span><span·class="p">:</span>·<span·class="n">pd</span><span·class="o">.</span><span·class="n">date_range</span><span·class="p">(</span><span·class="s2">"2001-01-01"</span><span·class="p">,</span>·<span·class="n">periods</span><span·class="o">=</span><span·class="mi">2</span><span·class="p">),</span> |
1184 | <span·class="gp">···....:·</span>····<span·class="p">},</span> | 1184 | <span·class="gp">···....:·</span>····<span·class="p">},</span> |
1185 | <span·class="gp">···....:·</span><span·class="p">)</span> | 1185 | <span·class="gp">···....:·</span><span·class="p">)</span> |
1186 | <span·class="gp">···....:·</span> | 1186 | <span·class="gp">···....:·</span> |
1187 | <span·class="gp">In·[46]:·</span><span·class="n">ds1</span><span·class="o">.</span><span·class="n">to_zarr</span><span·class="p">(</span><span·class="s2">"path/to/directory.zarr"</span><span·class="p">)</span> | 1187 | <span·class="gp">In·[46]:·</span><span·class="n">ds1</span><span·class="o">.</span><span·class="n">to_zarr</span><span·class="p">(</span><span·class="s2">"path/to/directory.zarr"</span><span·class="p">)</span> |
1188 | <span·class="gh">Out[46]:·</span><span·class="go"><xarray.backends.zarr.ZarrStore·at·0xffff | 1188 | <span·class="gh">Out[46]:·</span><span·class="go"><xarray.backends.zarr.ZarrStore·at·0xffff4074ee80></span> |
1189 | <span·class="gp">In·[47]:·</span><span·class="n">ds2</span>·<span·class="o">=</span>·<span·class="n">xr</span><span·class="o">.</span><span·class="n">Dataset</span><span·class="p">(</span> | 1189 | <span·class="gp">In·[47]:·</span><span·class="n">ds2</span>·<span·class="o">=</span>·<span·class="n">xr</span><span·class="o">.</span><span·class="n">Dataset</span><span·class="p">(</span> |
1190 | <span·class="gp">···....:·</span>····<span·class="p">{</span><span·class="s2">"foo"</span><span·class="p">:</span>·<span·class="p">((</span><span·class="s2">"x"</span><span·class="p">,</span>·<span·class="s2">"y"</span><span·class="p">,</span>·<span·class="s2">"t"</span><span·class="p">),</span>·<span·class="n">np</span><span·class="o">.</span><span·class="n">random</span><span·class="o">.</span><span·class="n">rand</span><span·class="p">(</span><span·class="mi">4</span><span·class="p">,</span>·<span·class="mi">5</span><span·class="p">,</span>·<span·class="mi">2</span><span·class="p">))},</span> | 1190 | <span·class="gp">···....:·</span>····<span·class="p">{</span><span·class="s2">"foo"</span><span·class="p">:</span>·<span·class="p">((</span><span·class="s2">"x"</span><span·class="p">,</span>·<span·class="s2">"y"</span><span·class="p">,</span>·<span·class="s2">"t"</span><span·class="p">),</span>·<span·class="n">np</span><span·class="o">.</span><span·class="n">random</span><span·class="o">.</span><span·class="n">rand</span><span·class="p">(</span><span·class="mi">4</span><span·class="p">,</span>·<span·class="mi">5</span><span·class="p">,</span>·<span·class="mi">2</span><span·class="p">))},</span> |
1191 | <span·class="gp">···....:·</span>····<span·class="n">coords</span><span·class="o">=</span><span·class="p">{</span> | 1191 | <span·class="gp">···....:·</span>····<span·class="n">coords</span><span·class="o">=</span><span·class="p">{</span> |
1192 | <span·class="gp">···....:·</span>········<span·class="s2">"x"</span><span·class="p">:</span>·<span·class="p">[</span><span·class="mi">10</span><span·class="p">,</span>·<span·class="mi">20</span><span·class="p">,</span>·<span·class="mi">30</span><span·class="p">,</span>·<span·class="mi">40</span><span·class="p">],</span> | 1192 | <span·class="gp">···....:·</span>········<span·class="s2">"x"</span><span·class="p">:</span>·<span·class="p">[</span><span·class="mi">10</span><span·class="p">,</span>·<span·class="mi">20</span><span·class="p">,</span>·<span·class="mi">30</span><span·class="p">,</span>·<span·class="mi">40</span><span·class="p">],</span> |
1193 | <span·class="gp">···....:·</span>········<span·class="s2">"y"</span><span·class="p">:</span>·<span·class="p">[</span><span·class="mi">1</span><span·class="p">,</span>·<span·class="mi">2</span><span·class="p">,</span>·<span·class="mi">3</span><span·class="p">,</span>·<span·class="mi">4</span><span·class="p">,</span>·<span·class="mi">5</span><span·class="p">],</span> | 1193 | <span·class="gp">···....:·</span>········<span·class="s2">"y"</span><span·class="p">:</span>·<span·class="p">[</span><span·class="mi">1</span><span·class="p">,</span>·<span·class="mi">2</span><span·class="p">,</span>·<span·class="mi">3</span><span·class="p">,</span>·<span·class="mi">4</span><span·class="p">,</span>·<span·class="mi">5</span><span·class="p">],</span> |
1194 | <span·class="gp">···....:·</span>········<span·class="s2">"t"</span><span·class="p">:</span>·<span·class="n">pd</span><span·class="o">.</span><span·class="n">date_range</span><span·class="p">(</span><span·class="s2">"2001-01-03"</span><span·class="p">,</span>·<span·class="n">periods</span><span·class="o">=</span><span·class="mi">2</span><span·class="p">),</span> | 1194 | <span·class="gp">···....:·</span>········<span·class="s2">"t"</span><span·class="p">:</span>·<span·class="n">pd</span><span·class="o">.</span><span·class="n">date_range</span><span·class="p">(</span><span·class="s2">"2001-01-03"</span><span·class="p">,</span>·<span·class="n">periods</span><span·class="o">=</span><span·class="mi">2</span><span·class="p">),</span> |
1195 | <span·class="gp">···....:·</span>····<span·class="p">},</span> | 1195 | <span·class="gp">···....:·</span>····<span·class="p">},</span> |
1196 | <span·class="gp">···....:·</span><span·class="p">)</span> | 1196 | <span·class="gp">···....:·</span><span·class="p">)</span> |
1197 | <span·class="gp">···....:·</span> | 1197 | <span·class="gp">···....:·</span> |
1198 | <span·class="gp">In·[48]:·</span><span·class="n">ds2</span><span·class="o">.</span><span·class="n">to_zarr</span><span·class="p">(</span><span·class="s2">"path/to/directory.zarr"</span><span·class="p">,</span>·<span·class="n">append_dim</span><span·class="o">=</span><span·class="s2">"t"</span><span·class="p">)</span> | 1198 | <span·class="gp">In·[48]:·</span><span·class="n">ds2</span><span·class="o">.</span><span·class="n">to_zarr</span><span·class="p">(</span><span·class="s2">"path/to/directory.zarr"</span><span·class="p">,</span>·<span·class="n">append_dim</span><span·class="o">=</span><span·class="s2">"t"</span><span·class="p">)</span> |
1199 | <span·class="gh">Out[48]:·</span><span·class="go"><xarray.backends.zarr.ZarrStore·at·0xffff | 1199 | <span·class="gh">Out[48]:·</span><span·class="go"><xarray.backends.zarr.ZarrStore·at·0xffff4074efa0></span> |
1200 | </pre></div> | 1200 | </pre></div> |
1201 | </div> | 1201 | </div> |
1202 | <p>Finally,·you·can·use·<code·class="docutils·literal·notranslate"><span·class="pre">region</span></code>·to·write·to·limited·regions·of·existing·arrays | 1202 | <p>Finally,·you·can·use·<code·class="docutils·literal·notranslate"><span·class="pre">region</span></code>·to·write·to·limited·regions·of·existing·arrays |
1203 | in·an·existing·Zarr·store.·This·is·a·good·option·for·writing·data·in·parallel | 1203 | in·an·existing·Zarr·store.·This·is·a·good·option·for·writing·data·in·parallel |
1204 | from·independent·processes.</p> | 1204 | from·independent·processes.</p> |
1205 | <p>To·scale·this·up·to·writing·large·datasets,·the·first·step·is·creating·an | 1205 | <p>To·scale·this·up·to·writing·large·datasets,·the·first·step·is·creating·an |
1206 | initial·Zarr·store·without·writing·all·of·its·array·data.·This·can·be·done·by | 1206 | initial·Zarr·store·without·writing·all·of·its·array·data.·This·can·be·done·by |
Offset 1218, 33 lines modified | Offset 1218, 33 lines modified | ||
1218 | <span·class="gp">In·[51]:·</span><span·class="n">ds</span>·<span·class="o">=</span>·<span·class="n">xr</span><span·class="o">.</span><span·class="n">Dataset</span><span·class="p">({</span><span·class="s2">"foo"</span><span·class="p">:</span>·<span·class="p">(</span><span·class="s2">"x"</span><span·class="p">,</span>·<span·class="n">dummies</span><span·class="p">)})</span> | 1218 | <span·class="gp">In·[51]:·</span><span·class="n">ds</span>·<span·class="o">=</span>·<span·class="n">xr</span><span·class="o">.</span><span·class="n">Dataset</span><span·class="p">({</span><span·class="s2">"foo"</span><span·class="p">:</span>·<span·class="p">(</span><span·class="s2">"x"</span><span·class="p">,</span>·<span·class="n">dummies</span><span·class="p">)})</span> |
1219 | <span·class="gp">In·[52]:·</span><span·class="n">path</span>·<span·class="o">=</span>·<span·class="s2">"path/to/directory.zarr"</span> | 1219 | <span·class="gp">In·[52]:·</span><span·class="n">path</span>·<span·class="o">=</span>·<span·class="s2">"path/to/directory.zarr"</span> |
1220 | <span·class="go">#·Now·we·write·the·metadata·without·computing·any·array·values</span> | 1220 | <span·class="go">#·Now·we·write·the·metadata·without·computing·any·array·values</span> |
1221 | <span·class="gp">In·[53]:·</span><span·class="n">ds</span><span·class="o">.</span><span·class="n">to_zarr</span><span·class="p">(</span><span·class="n">path</span><span·class="p">,</span>·<span·class="n">compute</span><span·class="o">=</span><span·class="kc">False</span><span·class="p">,</span>·<span·class="n">consolidated</span><span·class="o">=</span><span·class="kc">True</span><span·class="p">)</span> | 1221 | <span·class="gp">In·[53]:·</span><span·class="n">ds</span><span·class="o">.</span><span·class="n">to_zarr</span><span·class="p">(</span><span·class="n">path</span><span·class="p">,</span>·<span·class="n">compute</span><span·class="o">=</span><span·class="kc">False</span><span·class="p">,</span>·<span·class="n">consolidated</span><span·class="o">=</span><span·class="kc">True</span><span·class="p">)</span> |
1222 | <span·class="gh">Out[53]:·</span><span·class="go">Delayed('_finalize_store- | 1222 | <span·class="gh">Out[53]:·</span><span·class="go">Delayed('_finalize_store-aa004604-7456-43e7-a304-cbd78eb3f262')</span> |
1223 | </pre></div> | 1223 | </pre></div> |
1224 | </div> | 1224 | </div> |
1225 | <p>Now,·a·Zarr·store·with·the·correct·variable·shapes·and·attributes·exists·that | 1225 | <p>Now,·a·Zarr·store·with·the·correct·variable·shapes·and·attributes·exists·that |
1226 | can·be·filled·out·by·subsequent·calls·to·<code·class="docutils·literal·notranslate"><span·class="pre">to_zarr</span></code>.·The·<code·class="docutils·literal·notranslate"><span·class="pre">region</span></code>·provides·a | 1226 | can·be·filled·out·by·subsequent·calls·to·<code·class="docutils·literal·notranslate"><span·class="pre">to_zarr</span></code>.·The·<code·class="docutils·literal·notranslate"><span·class="pre">region</span></code>·provides·a |
1227 | mapping·from·dimension·names·to·Python·<code·class="docutils·literal·notranslate"><span·class="pre">slice</span></code>·objects·indicating·where·the | 1227 | mapping·from·dimension·names·to·Python·<code·class="docutils·literal·notranslate"><span·class="pre">slice</span></code>·objects·indicating·where·the |
1228 | data·should·be·written·(in·index·space,·not·coordinate·space),·e.g.,</p> | 1228 | data·should·be·written·(in·index·space,·not·coordinate·space),·e.g.,</p> |
1229 | <div·class="highlight-ipython·notranslate"><div·class="highlight"><pre><span></span><span·class="go">#·For·convenience,·we'll·slice·a·single·dataset,·but·in·the·real·use-case</span> | 1229 | <div·class="highlight-ipython·notranslate"><div·class="highlight"><pre><span></span><span·class="go">#·For·convenience,·we'll·slice·a·single·dataset,·but·in·the·real·use-case</span> |
1230 | <span·class="go">#·we·would·create·them·separately,·possibly·even·from·separate·processes.</span> | 1230 | <span·class="go">#·we·would·create·them·separately,·possibly·even·from·separate·processes.</span> |
1231 | <span·class="gp">In·[54]:·</span><span·class="n">ds</span>·<span·class="o">=</span>·<span·class="n">xr</span><span·class="o">.</span><span·class="n">Dataset</span><span·class="p">({</span><span·class="s2">"foo"</span><span·class="p">:</span>·<span·class="p">(</span><span·class="s2">"x"</span><span·class="p">,</span>·<span·class="n">np</span><span·class="o">.</span><span·class="n">arange</span><span·class="p">(</span><span·class="mi">30</span><span·class="p">))})</span> | 1231 | <span·class="gp">In·[54]:·</span><span·class="n">ds</span>·<span·class="o">=</span>·<span·class="n">xr</span><span·class="o">.</span><span·class="n">Dataset</span><span·class="p">({</span><span·class="s2">"foo"</span><span·class="p">:</span>·<span·class="p">(</span><span·class="s2">"x"</span><span·class="p">,</span>·<span·class="n">np</span><span·class="o">.</span><span·class="n">arange</span><span·class="p">(</span><span·class="mi">30</span><span·class="p">))})</span> |
1232 | <span·class="gp">In·[55]:·</span><span·class="n">ds</span><span·class="o">.</span><span·class="n">isel</span><span·class="p">(</span><span·class="n">x</span><span·class="o">=</span><span·class="nb">slice</span><span·class="p">(</span><span·class="mi">0</span><span·class="p">,</span>·<span·class="mi">10</span><span·class="p">))</span><span·class="o">.</span><span·class="n">to_zarr</span><span·class="p">(</span><span·class="n">path</span><span·class="p">,</span>·<span·class="n">region</span><span·class="o">=</span><span·class="p">{</span><span·class="s2">"x"</span><span·class="p">:</span>·<span·class="nb">slice</span><span·class="p">(</span><span·class="mi">0</span><span·class="p">,</span>·<span·class="mi">10</span><span·class="p">)})</span> | 1232 | <span·class="gp">In·[55]:·</span><span·class="n">ds</span><span·class="o">.</span><span·class="n">isel</span><span·class="p">(</span><span·class="n">x</span><span·class="o">=</span><span·class="nb">slice</span><span·class="p">(</span><span·class="mi">0</span><span·class="p">,</span>·<span·class="mi">10</span><span·class="p">))</span><span·class="o">.</span><span·class="n">to_zarr</span><span·class="p">(</span><span·class="n">path</span><span·class="p">,</span>·<span·class="n">region</span><span·class="o">=</span><span·class="p">{</span><span·class="s2">"x"</span><span·class="p">:</span>·<span·class="nb">slice</span><span·class="p">(</span><span·class="mi">0</span><span·class="p">,</span>·<span·class="mi">10</span><span·class="p">)})</span> |
1233 | <span·class="gh">Out[55]:·</span><span·class="go"><xarray.backends.zarr.ZarrStore·at·0xffff | 1233 | <span·class="gh">Out[55]:·</span><span·class="go"><xarray.backends.zarr.ZarrStore·at·0xffff4074eac0></span> |
1234 | <span·class="gp">In·[56]:·</span><span·class="n">ds</span><span·class="o">.</span><span·class="n">isel</span><span·class="p">(</span><span·class="n">x</span><span·class="o">=</span><span·class="nb">slice</span><span·class="p">(</span><span·class="mi">10</span><span·class="p">,</span>·<span·class="mi">20</span><span·class="p">))</span><span·class="o">.</span><span·class="n">to_zarr</span><span·class="p">(</span><span·class="n">path</span><span·class="p">,</span>·<span·class="n">region</span><span·class="o">=</span><span·class="p">{</span><span·class="s2">"x"</span><span·class="p">:</span>·<span·class="nb">slice</span><span·class="p">(</span><span·class="mi">10</span><span·class="p">,</span>·<span·class="mi">20</span><span·class="p">)})</span> | 1234 | <span·class="gp">In·[56]:·</span><span·class="n">ds</span><span·class="o">.</span><span·class="n">isel</span><span·class="p">(</span><span·class="n">x</span><span·class="o">=</span><span·class="nb">slice</span><span·class="p">(</span><span·class="mi">10</span><span·class="p">,</span>·<span·class="mi">20</span><span·class="p">))</span><span·class="o">.</span><span·class="n">to_zarr</span><span·class="p">(</span><span·class="n">path</span><span·class="p">,</span>·<span·class="n">region</span><span·class="o">=</span><span·class="p">{</span><span·class="s2">"x"</span><span·class="p">:</span>·<span·class="nb">slice</span><span·class="p">(</span><span·class="mi">10</span><span·class="p">,</span>·<span·class="mi">20</span><span·class="p">)})</span> |
1235 | <span·class="gh">Out[56]:·</span><span·class="go"><xarray.backends.zarr.ZarrStore·at·0xffff | 1235 | <span·class="gh">Out[56]:·</span><span·class="go"><xarray.backends.zarr.ZarrStore·at·0xffff4074e700></span> |
1236 | <span·class="gp">In·[57]:·</span><span·class="n">ds</span><span·class="o">.</span><span·class="n">isel</span><span·class="p">(</span><span·class="n">x</span><span·class="o">=</span><span·class="nb">slice</span><span·class="p">(</span><span·class="mi">20</span><span·class="p">,</span>·<span·class="mi">30</span><span·class="p">))</span><span·class="o">.</span><span·class="n">to_zarr</span><span·class="p">(</span><span·class="n">path</span><span·class="p">,</span>·<span·class="n">region</span><span·class="o">=</span><span·class="p">{</span><span·class="s2">"x"</span><span·class="p">:</span>·<span·class="nb">slice</span><span·class="p">(</span><span·class="mi">20</span><span·class="p">,</span>·<span·class="mi">30</span><span·class="p">)})</span> | 1236 | <span·class="gp">In·[57]:·</span><span·class="n">ds</span><span·class="o">.</span><span·class="n">isel</span><span·class="p">(</span><span·class="n">x</span><span·class="o">=</span><span·class="nb">slice</span><span·class="p">(</span><span·class="mi">20</span><span·class="p">,</span>·<span·class="mi">30</span><span·class="p">))</span><span·class="o">.</span><span·class="n">to_zarr</span><span·class="p">(</span><span·class="n">path</span><span·class="p">,</span>·<span·class="n">region</span><span·class="o">=</span><span·class="p">{</span><span·class="s2">"x"</span><span·class="p">:</span>·<span·class="nb">slice</span><span·class="p">(</span><span·class="mi">20</span><span·class="p">,</span>·<span·class="mi">30</span><span·class="p">)})</span> |
1237 | <span·class="gh">Out[57]:·</span><span·class="go"><xarray.backends.zarr.ZarrStore·at·0xffff | 1237 | <span·class="gh">Out[57]:·</span><span·class="go"><xarray.backends.zarr.ZarrStore·at·0xffff68a71340></span> |
1238 | </pre></div> | 1238 | </pre></div> |
1239 | </div> | 1239 | </div> |
1240 | <p>Concurrent·writes·with·<code·class="docutils·literal·notranslate"><span·class="pre">region</span></code>·are·safe·as·long·as·they·modify·distinct | 1240 | <p>Concurrent·writes·with·<code·class="docutils·literal·notranslate"><span·class="pre">region</span></code>·are·safe·as·long·as·they·modify·distinct |
1241 | chunks·in·the·underlying·Zarr·arrays·(or·use·an·appropriate·<code·class="docutils·literal·notranslate"><span·class="pre">lock</span></code>).</p> | 1241 | chunks·in·the·underlying·Zarr·arrays·(or·use·an·appropriate·<code·class="docutils·literal·notranslate"><span·class="pre">lock</span></code>).</p> |
1242 | <p>As·a·safety·check·to·make·it·harder·to·inadvertently·override·existing·values, | 1242 | <p>As·a·safety·check·to·make·it·harder·to·inadvertently·override·existing·values, |
1243 | if·you·set·<code·class="docutils·literal·notranslate"><span·class="pre">region</span></code>·then·<em>all</em>·variables·included·in·a·Dataset·must·have | 1243 | if·you·set·<code·class="docutils·literal·notranslate"><span·class="pre">region</span></code>·then·<em>all</em>·variables·included·in·a·Dataset·must·have |
1244 | dimensions·included·in·<code·class="docutils·literal·notranslate"><span·class="pre">region</span></code>.·Other·variables·(typically·coordinates) | 1244 | dimensions·included·in·<code·class="docutils·literal·notranslate"><span·class="pre">region</span></code>.·Other·variables·(typically·coordinates) |
Offset 762, 15 lines modified | Offset 762, 15 lines modified | ||
762 | ···....:·········"y":·pd.date_range("2000-01-01",·periods=5), | 762 | ···....:·········"y":·pd.date_range("2000-01-01",·periods=5), |
763 | ···....:·········"z":·("x",·list("abcd")), | 763 | ···....:·········"z":·("x",·list("abcd")), |
764 | ···....:·····}, | 764 | ···....:·····}, |
765 | ···....:·) | 765 | ···....:·) |
766 | ···....: | 766 | ···....: |
767 | In·[39]:·ds.to_zarr("path/to/directory.zarr") | 767 | In·[39]:·ds.to_zarr("path/to/directory.zarr") |
768 | Out[39]:·<xarray.backends.zarr.ZarrStore·at·0xffff | 768 | Out[39]:·<xarray.backends.zarr.ZarrStore·at·0xffff4074e1c0> |
769 | (The·suffix·.zarr·is·optionalâjust·a·reminder·that·a·zarr·store·lives·there.) | 769 | (The·suffix·.zarr·is·optionalâjust·a·reminder·that·a·zarr·store·lives·there.) |
770 | If·the·directory·does·not·exist,·it·will·be·created.·If·a·zarr·store·is·already | 770 | If·the·directory·does·not·exist,·it·will·be·created.·If·a·zarr·store·is·already |
771 | present·at·that·path,·an·error·will·be·raised,·preventing·it·from·being | 771 | present·at·that·path,·an·error·will·be·raised,·preventing·it·from·being |
772 | overwritten.·To·override·this·behavior·and·overwrite·an·existing·store,·add | 772 | overwritten.·To·override·this·behavior·and·overwrite·an·existing·store,·add |
773 | mode='w'·when·invoking·to_zarr(). | 773 | mode='w'·when·invoking·to_zarr(). |
774 | To·store·variable·length·strings,·convert·them·to·object·arrays·first·with | 774 | To·store·variable·length·strings,·convert·them·to·object·arrays·first·with |
775 | dtype=object. | 775 | dtype=object. |
Offset 806, 15 lines modified | Offset 806, 15 lines modified | ||
806 | zarr.·These·are·described·in·the·zarr_documentation.·These·options·can·be | 806 | zarr.·These·are·described·in·the·zarr_documentation.·These·options·can·be |
807 | passed·to·the·to_zarr·method·as·variable·encoding.·For·example: | 807 | passed·to·the·to_zarr·method·as·variable·encoding.·For·example: |
808 | In·[42]:·import·zarr | 808 | In·[42]:·import·zarr |
809 | In·[43]:·compressor·=·zarr.Blosc(cname="zstd",·clevel=3,·shuffle=2) | 809 | In·[43]:·compressor·=·zarr.Blosc(cname="zstd",·clevel=3,·shuffle=2) |
810 | In·[44]:·ds.to_zarr("foo.zarr",·encoding={"foo":·{"compressor":·compressor}}) | 810 | In·[44]:·ds.to_zarr("foo.zarr",·encoding={"foo":·{"compressor":·compressor}}) |
811 | Out[44]:·<xarray.backends.zarr.ZarrStore·at·0xffff | 811 | Out[44]:·<xarray.backends.zarr.ZarrStore·at·0xffff4074e520> |
812 | Note | 812 | Note |
813 | Not·all·native·zarr·compression·and·filtering·options·have·been·tested·with | 813 | Not·all·native·zarr·compression·and·filtering·options·have·been·tested·with |
814 | xarray. | 814 | xarray. |
815 | ****·Consolidated·Metadata¶·**** | 815 | ****·Consolidated·Metadata¶·**** |
816 | Xarray·needs·to·read·all·of·the·zarr·metadata·when·it·opens·a·dataset.·In·some | 816 | Xarray·needs·to·read·all·of·the·zarr·metadata·when·it·opens·a·dataset.·In·some |
817 | storage·mediums,·such·as·with·cloud·object·storage·(e.g.·amazon·S3),·this·can | 817 | storage·mediums,·such·as·with·cloud·object·storage·(e.g.·amazon·S3),·this·can |
818 | introduce·significant·overhead,·because·two·separate·HTTP·calls·to·the·object | 818 | introduce·significant·overhead,·because·two·separate·HTTP·calls·to·the·object |
Offset 854, 28 lines modified | Offset 854, 28 lines modified | ||
854 | ···....:·········"y":·[1,·2,·3,·4,·5], | 854 | ···....:·········"y":·[1,·2,·3,·4,·5], |
855 | ···....:·········"t":·pd.date_range("2001-01-01",·periods=2), | 855 | ···....:·········"t":·pd.date_range("2001-01-01",·periods=2), |
856 | ···....:·····}, | 856 | ···....:·····}, |
857 | ···....:·) | 857 | ···....:·) |
858 | ···....: | 858 | ···....: |
859 | In·[46]:·ds1.to_zarr("path/to/directory.zarr") | 859 | In·[46]:·ds1.to_zarr("path/to/directory.zarr") |
860 | Out[46]:·<xarray.backends.zarr.ZarrStore·at·0xffff | 860 | Out[46]:·<xarray.backends.zarr.ZarrStore·at·0xffff4074ee80> |
861 | In·[47]:·ds2·=·xr.Dataset( | 861 | In·[47]:·ds2·=·xr.Dataset( |
862 | ···....:·····{"foo":·(("x",·"y",·"t"),·np.random.rand(4,·5,·2))}, | 862 | ···....:·····{"foo":·(("x",·"y",·"t"),·np.random.rand(4,·5,·2))}, |
863 | ···....:·····coords={ | 863 | ···....:·····coords={ |
864 | ···....:·········"x":·[10,·20,·30,·40], | 864 | ···....:·········"x":·[10,·20,·30,·40], |
865 | ···....:·········"y":·[1,·2,·3,·4,·5], | 865 | ···....:·········"y":·[1,·2,·3,·4,·5], |
866 | ···....:·········"t":·pd.date_range("2001-01-03",·periods=2), | 866 | ···....:·········"t":·pd.date_range("2001-01-03",·periods=2), |
867 | ···....:·····}, | 867 | ···....:·····}, |
868 | ···....:·) | 868 | ···....:·) |
869 | ···....: | 869 | ···....: |
870 | In·[48]:·ds2.to_zarr("path/to/directory.zarr",·append_dim="t") | 870 | In·[48]:·ds2.to_zarr("path/to/directory.zarr",·append_dim="t") |
871 | Out[48]:·<xarray.backends.zarr.ZarrStore·at·0xffff | 871 | Out[48]:·<xarray.backends.zarr.ZarrStore·at·0xffff4074efa0> |
872 | Finally,·you·can·use·region·to·write·to·limited·regions·of·existing·arrays·in | 872 | Finally,·you·can·use·region·to·write·to·limited·regions·of·existing·arrays·in |
873 | an·existing·Zarr·store.·This·is·a·good·option·for·writing·data·in·parallel·from | 873 | an·existing·Zarr·store.·This·is·a·good·option·for·writing·data·in·parallel·from |
874 | independent·processes. | 874 | independent·processes. |
875 | To·scale·this·up·to·writing·large·datasets,·the·first·step·is·creating·an | 875 | To·scale·this·up·to·writing·large·datasets,·the·first·step·is·creating·an |
876 | initial·Zarr·store·without·writing·all·of·its·array·data.·This·can·be·done·by | 876 | initial·Zarr·store·without·writing·all·of·its·array·data.·This·can·be·done·by |
877 | first·creating·a·Dataset·with·dummy·values·stored·in·dask,·and·then·calling | 877 | first·creating·a·Dataset·with·dummy·values·stored·in·dask,·and·then·calling |
878 | to_zarr·with·compute=False·to·write·only·metadata·(including·attrs)·to·Zarr: | 878 | to_zarr·with·compute=False·to·write·only·metadata·(including·attrs)·to·Zarr: |
Offset 887, 31 lines modified | Offset 887, 31 lines modified | ||
887 | In·[51]:·ds·=·xr.Dataset({"foo":·("x",·dummies)}) | 887 | In·[51]:·ds·=·xr.Dataset({"foo":·("x",·dummies)}) |
888 | In·[52]:·path·=·"path/to/directory.zarr" | 888 | In·[52]:·path·=·"path/to/directory.zarr" |
889 | #·Now·we·write·the·metadata·without·computing·any·array·values | 889 | #·Now·we·write·the·metadata·without·computing·any·array·values |
890 | In·[53]:·ds.to_zarr(path,·compute=False,·consolidated=True) | 890 | In·[53]:·ds.to_zarr(path,·compute=False,·consolidated=True) |
891 | Out[53]:·Delayed('_finalize_store- | 891 | Out[53]:·Delayed('_finalize_store-aa004604-7456-43e7-a304-cbd78eb3f262') |
892 | Now,·a·Zarr·store·with·the·correct·variable·shapes·and·attributes·exists·that | 892 | Now,·a·Zarr·store·with·the·correct·variable·shapes·and·attributes·exists·that |
893 | can·be·filled·out·by·subsequent·calls·to·to_zarr.·The·region·provides·a·mapping | 893 | can·be·filled·out·by·subsequent·calls·to·to_zarr.·The·region·provides·a·mapping |
894 | from·dimension·names·to·Python·slice·objects·indicating·where·the·data·should | 894 | from·dimension·names·to·Python·slice·objects·indicating·where·the·data·should |
895 | be·written·(in·index·space,·not·coordinate·space),·e.g., | 895 | be·written·(in·index·space,·not·coordinate·space),·e.g., |
896 | #·For·convenience,·we'll·slice·a·single·dataset,·but·in·the·real·use-case | 896 | #·For·convenience,·we'll·slice·a·single·dataset,·but·in·the·real·use-case |
897 | #·we·would·create·them·separately,·possibly·even·from·separate·processes. | 897 | #·we·would·create·them·separately,·possibly·even·from·separate·processes. |
898 | In·[54]:·ds·=·xr.Dataset({"foo":·("x",·np.arange(30))}) | 898 | In·[54]:·ds·=·xr.Dataset({"foo":·("x",·np.arange(30))}) |
899 | In·[55]:·ds.isel(x=slice(0,·10)).to_zarr(path,·region={"x":·slice(0,·10)}) | 899 | In·[55]:·ds.isel(x=slice(0,·10)).to_zarr(path,·region={"x":·slice(0,·10)}) |
900 | Out[55]:·<xarray.backends.zarr.ZarrStore·at·0xffff | 900 | Out[55]:·<xarray.backends.zarr.ZarrStore·at·0xffff4074eac0> |
901 | In·[56]:·ds.isel(x=slice(10,·20)).to_zarr(path,·region={"x":·slice(10,·20)}) | 901 | In·[56]:·ds.isel(x=slice(10,·20)).to_zarr(path,·region={"x":·slice(10,·20)}) |
902 | Out[56]:·<xarray.backends.zarr.ZarrStore·at·0xffff | 902 | Out[56]:·<xarray.backends.zarr.ZarrStore·at·0xffff4074e700> |
903 | In·[57]:·ds.isel(x=slice(20,·30)).to_zarr(path,·region={"x":·slice(20,·30)}) | 903 | In·[57]:·ds.isel(x=slice(20,·30)).to_zarr(path,·region={"x":·slice(20,·30)}) |
904 | Out[57]:·<xarray.backends.zarr.ZarrStore·at·0xffff | 904 | Out[57]:·<xarray.backends.zarr.ZarrStore·at·0xffff68a71340> |
905 | Concurrent·writes·with·region·are·safe·as·long·as·they·modify·distinct·chunks | 905 | Concurrent·writes·with·region·are·safe·as·long·as·they·modify·distinct·chunks |
906 | in·the·underlying·Zarr·arrays·(or·use·an·appropriate·lock). | 906 | in·the·underlying·Zarr·arrays·(or·use·an·appropriate·lock). |
907 | As·a·safety·check·to·make·it·harder·to·inadvertently·override·existing·values, | 907 | As·a·safety·check·to·make·it·harder·to·inadvertently·override·existing·values, |
908 | if·you·set·region·then·all·variables·included·in·a·Dataset·must·have·dimensions | 908 | if·you·set·region·then·all·variables·included·in·a·Dataset·must·have·dimensions |
909 | included·in·region.·Other·variables·(typically·coordinates)·need·to·be | 909 | included·in·region.·Other·variables·(typically·coordinates)·need·to·be |
910 | explicitly·dropped·and/or·written·in·a·separate·calls·to·to_zarr·with·mode='a'. | 910 | explicitly·dropped·and/or·written·in·a·separate·calls·to·to_zarr·with·mode='a'. |
911 | *****·GRIB·format·via·cfgrib¶·***** | 911 | *****·GRIB·format·via·cfgrib¶·***** |
Offset 326, 15 lines modified | Offset 326, 15 lines modified | ||
326 | <span·class="nn">/build/reproducible-path/python-xarray-0.16.2/xarray/tutorial.py</span>·in·<span·class="ni">open_dataset</span><span·class="nt">(name,·cache,·cache_dir,·github_url,·branch,·**kws)</span> | 326 | <span·class="nn">/build/reproducible-path/python-xarray-0.16.2/xarray/tutorial.py</span>·in·<span·class="ni">open_dataset</span><span·class="nt">(name,·cache,·cache_dir,·github_url,·branch,·**kws)</span> |
327 | <span·class="g·g-Whitespace">·····</span><span·class="mi">76</span>·········<span·class="c1">#·May·want·to·add·an·option·to·remove·it.</span> | 327 | <span·class="g·g-Whitespace">·····</span><span·class="mi">76</span>·········<span·class="c1">#·May·want·to·add·an·option·to·remove·it.</span> |
328 | <span·class="g·g-Whitespace">·····</span><span·class="mi">77</span>·········<span·class="k">if</span>·<span·class="ow">not</span>·<span·class="n">_os</span><span·class="o">.</span><span·class="n">path</span><span·class="o">.</span><span·class="n">isdir</span><span·class="p">(</span><span·class="n">longdir</span><span·class="p">):</span> | 328 | <span·class="g·g-Whitespace">·····</span><span·class="mi">77</span>·········<span·class="k">if</span>·<span·class="ow">not</span>·<span·class="n">_os</span><span·class="o">.</span><span·class="n">path</span><span·class="o">.</span><span·class="n">isdir</span><span·class="p">(</span><span·class="n">longdir</span><span·class="p">):</span> |
329 | <span·class="ne">--->·</span><span·class="mi">78</span>·············<span·class="n">_os</span><span·class="o">.</span><span·class="n">mkdir</span><span·class="p">(</span><span·class="n">longdir</span><span·class="p">)</span> | 329 | <span·class="ne">--->·</span><span·class="mi">78</span>·············<span·class="n">_os</span><span·class="o">.</span><span·class="n">mkdir</span><span·class="p">(</span><span·class="n">longdir</span><span·class="p">)</span> |
330 | <span·class="g·g-Whitespace">·····</span><span·class="mi">79</span>· | 330 | <span·class="g·g-Whitespace">·····</span><span·class="mi">79</span>· |
331 | <span·class="g·g-Whitespace">·····</span><span·class="mi">80</span>·········<span·class="n">url</span>·<span·class="o">=</span>·<span·class="s2">"/"</span><span·class="o">.</span><span·class="n">join</span><span·class="p">((</span><span·class="n">github_url</span><span·class="p">,</span>·<span·class="s2">"raw"</span><span·class="p">,</span>·<span·class="n">branch</span><span·class="p">,</span>·<span·class="n">fullname</span><span·class="p">))</span> | 331 | <span·class="g·g-Whitespace">·····</span><span·class="mi">80</span>·········<span·class="n">url</span>·<span·class="o">=</span>·<span·class="s2">"/"</span><span·class="o">.</span><span·class="n">join</span><span·class="p">((</span><span·class="n">github_url</span><span·class="p">,</span>·<span·class="s2">"raw"</span><span·class="p">,</span>·<span·class="n">branch</span><span·class="p">,</span>·<span·class="n">fullname</span><span·class="p">))</span> |
332 | <span·class="ne">FileNotFoundError</span>:·[Errno·2]·No·such·file·or·directory:·'/nonexistent/ | 332 | <span·class="ne">FileNotFoundError</span>:·[Errno·2]·No·such·file·or·directory:·'/nonexistent/second-build/.xarray_tutorial_data' |
333 | <span·class="gp">In·[6]:·</span><span·class="n">airtemps</span> | 333 | <span·class="gp">In·[6]:·</span><span·class="n">airtemps</span> |
334 | <span·class="gt">---------------------------------------------------------------------------</span> | 334 | <span·class="gt">---------------------------------------------------------------------------</span> |
335 | <span·class="ne">NameError</span><span·class="g·g-Whitespace">·································</span>Traceback·(most·recent·call·last) | 335 | <span·class="ne">NameError</span><span·class="g·g-Whitespace">·································</span>Traceback·(most·recent·call·last) |
336 | <span·class="o"><</span><span·class="n">ipython</span><span·class="o">-</span><span·class="nb">input</span><span·class="o">-</span><span·class="mi">6</span><span·class="o">-</span><span·class="n">eb57b540ddce</span><span·class="o">></span>·<span·class="ow">in</span>·<span·class="o"><</span><span·class="n">module</span><span·class="o">></span> | 336 | <span·class="o"><</span><span·class="n">ipython</span><span·class="o">-</span><span·class="nb">input</span><span·class="o">-</span><span·class="mi">6</span><span·class="o">-</span><span·class="n">eb57b540ddce</span><span·class="o">></span>·<span·class="ow">in</span>·<span·class="o"><</span><span·class="n">module</span><span·class="o">></span> |
337 | <span·class="ne">---->·</span><span·class="mi">1</span>·<span·class="n">airtemps</span> | 337 | <span·class="ne">---->·</span><span·class="mi">1</span>·<span·class="n">airtemps</span> |
Offset 852, 15 lines modified | Offset 852, 15 lines modified | ||
852 | <span·class="ne">-->·</span><span·class="mi">171</span>·········<span·class="n">ref_var</span>·<span·class="o">=</span>·<span·class="n">variables</span><span·class="p">[</span><span·class="n">ref_name</span><span·class="p">]</span> | 852 | <span·class="ne">-->·</span><span·class="mi">171</span>·········<span·class="n">ref_var</span>·<span·class="o">=</span>·<span·class="n">variables</span><span·class="p">[</span><span·class="n">ref_name</span><span·class="p">]</span> |
853 | <span·class="g·g-Whitespace">····</span><span·class="mi">172</span>· | 853 | <span·class="g·g-Whitespace">····</span><span·class="mi">172</span>· |
854 | <span·class="g·g-Whitespace">····</span><span·class="mi">173</span>·····<span·class="k">if</span>·<span·class="n">var_name</span>·<span·class="ow">is</span>·<span·class="kc">None</span><span·class="p">:</span> | 854 | <span·class="g·g-Whitespace">····</span><span·class="mi">173</span>·····<span·class="k">if</span>·<span·class="n">var_name</span>·<span·class="ow">is</span>·<span·class="kc">None</span><span·class="p">:</span> |
855 | <span·class="ne">KeyError</span>:·'lat' | 855 | <span·class="ne">KeyError</span>:·'lat' |
856 | <span·class="gp">In·[51]:·</span><span·class="n">b</span><span·class="o">.</span><span·class="n">plot</span><span·class="p">()</span> | 856 | <span·class="gp">In·[51]:·</span><span·class="n">b</span><span·class="o">.</span><span·class="n">plot</span><span·class="p">()</span> |
857 | <span·class="gh">Out[51]:·</span><span·class="go">[<matplotlib.lines.Line2D·at·0xffff | 857 | <span·class="gh">Out[51]:·</span><span·class="go">[<matplotlib.lines.Line2D·at·0xffff40184d00>]</span> |
858 | </pre></div> | 858 | </pre></div> |
859 | </div> | 859 | </div> |
860 | <a·class="reference·internal·image-reference"·href="_images/plotting_nonuniform_coords.png"><img·alt="_images/plotting_nonuniform_coords.png"·src="_images/plotting_nonuniform_coords.png"·style="width:·4in;"·/></a> | 860 | <a·class="reference·internal·image-reference"·href="_images/plotting_nonuniform_coords.png"><img·alt="_images/plotting_nonuniform_coords.png"·src="_images/plotting_nonuniform_coords.png"·style="width:·4in;"·/></a> |
861 | </div> | 861 | </div> |
862 | <div·class="section"·id="calling-matplotlib"> | 862 | <div·class="section"·id="calling-matplotlib"> |
863 | <h4>Calling·Matplotlib<a·class="headerlink"·href="#calling-matplotlib"·title="Permalink·to·this·headline">¶</a></h4> | 863 | <h4>Calling·Matplotlib<a·class="headerlink"·href="#calling-matplotlib"·title="Permalink·to·this·headline">¶</a></h4> |
864 | <p>Since·this·is·a·thin·wrapper·around·matplotlib,·all·the·functionality·of | 864 | <p>Since·this·is·a·thin·wrapper·around·matplotlib,·all·the·functionality·of |
Offset 1314, 56 lines modified | Offset 1314, 56 lines modified | ||
1314 | <span·class="go">Data·variables:</span> | 1314 | <span·class="go">Data·variables:</span> |
1315 | <span·class="go">····A········(x,·y,·z,·w)·float64·-0.104·0.02719·-0.0425·...·-0.1175·-0.0183</span> | 1315 | <span·class="go">····A········(x,·y,·z,·w)·float64·-0.104·0.02719·-0.0425·...·-0.1175·-0.0183</span> |
1316 | <span·class="go">····B········(x,·y,·z,·w)·float64·0.0·0.0·0.0·0.0·...·1.369·1.408·1.387·1.417</span> | 1316 | <span·class="go">····B········(x,·y,·z,·w)·float64·0.0·0.0·0.0·0.0·...·1.369·1.408·1.387·1.417</span> |
1317 | </pre></div> | 1317 | </pre></div> |
1318 | </div> | 1318 | </div> |
1319 | <p>Suppose·we·want·to·scatter·<code·class="docutils·literal·notranslate"><span·class="pre">A</span></code>·against·<code·class="docutils·literal·notranslate"><span·class="pre">B</span></code></p> | 1319 | <p>Suppose·we·want·to·scatter·<code·class="docutils·literal·notranslate"><span·class="pre">A</span></code>·against·<code·class="docutils·literal·notranslate"><span·class="pre">B</span></code></p> |
1320 | <div·class="highlight-ipython·notranslate"><div·class="highlight"><pre><span></span><span·class="gp">In·[95]:·</span><span·class="n">ds</span><span·class="o">.</span><span·class="n">plot</span><span·class="o">.</span><span·class="n">scatter</span><span·class="p">(</span><span·class="n">x</span><span·class="o">=</span><span·class="s2">"A"</span><span·class="p">,</span>·<span·class="n">y</span><span·class="o">=</span><span·class="s2">"B"</span><span·class="p">)</span> | 1320 | <div·class="highlight-ipython·notranslate"><div·class="highlight"><pre><span></span><span·class="gp">In·[95]:·</span><span·class="n">ds</span><span·class="o">.</span><span·class="n">plot</span><span·class="o">.</span><span·class="n">scatter</span><span·class="p">(</span><span·class="n">x</span><span·class="o">=</span><span·class="s2">"A"</span><span·class="p">,</span>·<span·class="n">y</span><span·class="o">=</span><span·class="s2">"B"</span><span·class="p">)</span> |
1321 | <span·class="gh">Out[95]:·</span><span·class="go"><matplotlib.collections.PathCollection·at·0xffff | 1321 | <span·class="gh">Out[95]:·</span><span·class="go"><matplotlib.collections.PathCollection·at·0xffff402f9580></span> |
1322 | </pre></div> | 1322 | </pre></div> |
1323 | </div> | 1323 | </div> |
1324 | <img·alt="_images/ds_simple_scatter.png"·src="_images/ds_simple_scatter.png"·/> | 1324 | <img·alt="_images/ds_simple_scatter.png"·src="_images/ds_simple_scatter.png"·/> |
1325 | <p>The·<code·class="docutils·literal·notranslate"><span·class="pre">hue</span></code>·kwarg·lets·you·vary·the·color·by·variable·value</p> | 1325 | <p>The·<code·class="docutils·literal·notranslate"><span·class="pre">hue</span></code>·kwarg·lets·you·vary·the·color·by·variable·value</p> |
1326 | <div·class="highlight-ipython·notranslate"><div·class="highlight"><pre><span></span><span·class="gp">In·[96]:·</span><span·class="n">ds</span><span·class="o">.</span><span·class="n">plot</span><span·class="o">.</span><span·class="n">scatter</span><span·class="p">(</span><span·class="n">x</span><span·class="o">=</span><span·class="s2">"A"</span><span·class="p">,</span>·<span·class="n">y</span><span·class="o">=</span><span·class="s2">"B"</span><span·class="p">,</span>·<span·class="n">hue</span><span·class="o">=</span><span·class="s2">"w"</span><span·class="p">)</span> | 1326 | <div·class="highlight-ipython·notranslate"><div·class="highlight"><pre><span></span><span·class="gp">In·[96]:·</span><span·class="n">ds</span><span·class="o">.</span><span·class="n">plot</span><span·class="o">.</span><span·class="n">scatter</span><span·class="p">(</span><span·class="n">x</span><span·class="o">=</span><span·class="s2">"A"</span><span·class="p">,</span>·<span·class="n">y</span><span·class="o">=</span><span·class="s2">"B"</span><span·class="p">,</span>·<span·class="n">hue</span><span·class="o">=</span><span·class="s2">"w"</span><span·class="p">)</span> |
1327 | <span·class="gh">Out[96]:·</span><span·class="go"></span> | 1327 | <span·class="gh">Out[96]:·</span><span·class="go"></span> |
1328 | <span·class="go">[<matplotlib.collections.PathCollection·at·0xffff682bbe80>,</span> | ||
1328 | <span·class="go"> | 1329 | <span·class="go">·<matplotlib.collections.PathCollection·at·0xffff688c7100>,</span> |
1329 | <span·class="go">·<matplotlib.collections.PathCollection·at·0xffff6c | 1330 | <span·class="go">·<matplotlib.collections.PathCollection·at·0xffff6acc2df0>,</span> |
1330 | <span·class="go">·<matplotlib.collections.PathCollection·at·0xffff6c3df6d0>,</span> | ||
1331 | <span·class="go">·<matplotlib.collections.PathCollection·at·0xffff | 1331 | <span·class="go">·<matplotlib.collections.PathCollection·at·0xffff6812a580>]</span> |
1332 | </pre></div> | 1332 | </pre></div> |
1333 | </div> | 1333 | </div> |
1334 | <img·alt="_images/ds_hue_scatter.png"·src="_images/ds_hue_scatter.png"·/> | 1334 | <img·alt="_images/ds_hue_scatter.png"·src="_images/ds_hue_scatter.png"·/> |
1335 | <p>When·<code·class="docutils·literal·notranslate"><span·class="pre">hue</span></code>·is·specified,·a·colorbar·is·added·for·numeric·<code·class="docutils·literal·notranslate"><span·class="pre">hue</span></code>·DataArrays·by | 1335 | <p>When·<code·class="docutils·literal·notranslate"><span·class="pre">hue</span></code>·is·specified,·a·colorbar·is·added·for·numeric·<code·class="docutils·literal·notranslate"><span·class="pre">hue</span></code>·DataArrays·by |
1336 | default·and·a·legend·is·added·for·non-numeric·<code·class="docutils·literal·notranslate"><span·class="pre">hue</span></code>·DataArrays·(as·above). | 1336 | default·and·a·legend·is·added·for·non-numeric·<code·class="docutils·literal·notranslate"><span·class="pre">hue</span></code>·DataArrays·(as·above). |
1337 | You·can·force·a·legend·instead·of·a·colorbar·by·setting·<code·class="docutils·literal·notranslate"><span·class="pre">hue_style='discrete'</span></code>. | 1337 | You·can·force·a·legend·instead·of·a·colorbar·by·setting·<code·class="docutils·literal·notranslate"><span·class="pre">hue_style='discrete'</span></code>. |
1338 | Additionally,·the·boolean·kwarg·<code·class="docutils·literal·notranslate"><span·class="pre">add_guide</span></code>·can·be·used·to·prevent·the·display·of·a·legend·or·colorbar·(as·appropriate).</p> | 1338 | Additionally,·the·boolean·kwarg·<code·class="docutils·literal·notranslate"><span·class="pre">add_guide</span></code>·can·be·used·to·prevent·the·display·of·a·legend·or·colorbar·(as·appropriate).</p> |
1339 | <div·class="highlight-ipython·notranslate"><div·class="highlight"><pre><span></span><span·class="gp">In·[97]:·</span><span·class="n">ds</span>·<span·class="o">=</span>·<span·class="n">ds</span><span·class="o">.</span><span·class="n">assign</span><span·class="p">(</span><span·class="n">w</span><span·class="o">=</span><span·class="p">[</span><span·class="mi">1</span><span·class="p">,</span>·<span·class="mi">2</span><span·class="p">,</span>·<span·class="mi">3</span><span·class="p">,</span>·<span·class="mi">5</span><span·class="p">])</span> | 1339 | <div·class="highlight-ipython·notranslate"><div·class="highlight"><pre><span></span><span·class="gp">In·[97]:·</span><span·class="n">ds</span>·<span·class="o">=</span>·<span·class="n">ds</span><span·class="o">.</span><span·class="n">assign</span><span·class="p">(</span><span·class="n">w</span><span·class="o">=</span><span·class="p">[</span><span·class="mi">1</span><span·class="p">,</span>·<span·class="mi">2</span><span·class="p">,</span>·<span·class="mi">3</span><span·class="p">,</span>·<span·class="mi">5</span><span·class="p">])</span> |
1340 | <span·class="gp">In·[98]:·</span><span·class="n">ds</span><span·class="o">.</span><span·class="n">plot</span><span·class="o">.</span><span·class="n">scatter</span><span·class="p">(</span><span·class="n">x</span><span·class="o">=</span><span·class="s2">"A"</span><span·class="p">,</span>·<span·class="n">y</span><span·class="o">=</span><span·class="s2">"B"</span><span·class="p">,</span>·<span·class="n">hue</span><span·class="o">=</span><span·class="s2">"w"</span><span·class="p">,</span>·<span·class="n">hue_style</span><span·class="o">=</span><span·class="s2">"discrete"</span><span·class="p">)</span> | 1340 | <span·class="gp">In·[98]:·</span><span·class="n">ds</span><span·class="o">.</span><span·class="n">plot</span><span·class="o">.</span><span·class="n">scatter</span><span·class="p">(</span><span·class="n">x</span><span·class="o">=</span><span·class="s2">"A"</span><span·class="p">,</span>·<span·class="n">y</span><span·class="o">=</span><span·class="s2">"B"</span><span·class="p">,</span>·<span·class="n">hue</span><span·class="o">=</span><span·class="s2">"w"</span><span·class="p">,</span>·<span·class="n">hue_style</span><span·class="o">=</span><span·class="s2">"discrete"</span><span·class="p">)</span> |
1341 | <span·class="gh">Out[98]:·</span><span·class="go"></span> | 1341 | <span·class="gh">Out[98]:·</span><span·class="go"></span> |
1342 | <span·class="go">[<matplotlib.collections.PathCollection·at·0xffff6 | 1342 | <span·class="go">[<matplotlib.collections.PathCollection·at·0xffff68277040>,</span> |
1343 | <span·class="go">·<matplotlib.collections.PathCollection·at·0xffff | 1343 | <span·class="go">·<matplotlib.collections.PathCollection·at·0xffff582932b0>,</span> |
1344 | <span·class="go">·<matplotlib.collections.PathCollection·at·0xffff | 1344 | <span·class="go">·<matplotlib.collections.PathCollection·at·0xffff5836ff10>,</span> |
1345 | <span·class="go">·<matplotlib.collections.PathCollection·at·0xffff6 | 1345 | <span·class="go">·<matplotlib.collections.PathCollection·at·0xffff690cc430>]</span> |
1346 | </pre></div> | 1346 | </pre></div> |
1347 | </div> | 1347 | </div> |
1348 | <img·alt="_images/ds_discrete_legend_hue_scatter.png"·src="_images/ds_discrete_legend_hue_scatter.png"·/> | 1348 | <img·alt="_images/ds_discrete_legend_hue_scatter.png"·src="_images/ds_discrete_legend_hue_scatter.png"·/> |
1349 | <p>The·<code·class="docutils·literal·notranslate"><span·class="pre">markersize</span></code>·kwarg·lets·you·vary·the·point’s·size·by·variable·value.·You·can·additionally·pass·<code·class="docutils·literal·notranslate"><span·class="pre">size_norm</span></code>·to·control·how·the·variable’s·values·are·mapped·to·point·sizes.</p> | 1349 | <p>The·<code·class="docutils·literal·notranslate"><span·class="pre">markersize</span></code>·kwarg·lets·you·vary·the·point’s·size·by·variable·value.·You·can·additionally·pass·<code·class="docutils·literal·notranslate"><span·class="pre">size_norm</span></code>·to·control·how·the·variable’s·values·are·mapped·to·point·sizes.</p> |
1350 | <div·class="highlight-ipython·notranslate"><div·class="highlight"><pre><span></span><span·class="gp">In·[99]:·</span><span·class="n">ds</span><span·class="o">.</span><span·class="n">plot</span><span·class="o">.</span><span·class="n">scatter</span><span·class="p">(</span><span·class="n">x</span><span·class="o">=</span><span·class="s2">"A"</span><span·class="p">,</span>·<span·class="n">y</span><span·class="o">=</span><span·class="s2">"B"</span><span·class="p">,</span>·<span·class="n">hue</span><span·class="o">=</span><span·class="s2">"z"</span><span·class="p">,</span>·<span·class="n">hue_style</span><span·class="o">=</span><span·class="s2">"discrete"</span><span·class="p">,</span>·<span·class="n">markersize</span><span·class="o">=</span><span·class="s2">"z"</span><span·class="p">)</span> | 1350 | <div·class="highlight-ipython·notranslate"><div·class="highlight"><pre><span></span><span·class="gp">In·[99]:·</span><span·class="n">ds</span><span·class="o">.</span><span·class="n">plot</span><span·class="o">.</span><span·class="n">scatter</span><span·class="p">(</span><span·class="n">x</span><span·class="o">=</span><span·class="s2">"A"</span><span·class="p">,</span>·<span·class="n">y</span><span·class="o">=</span><span·class="s2">"B"</span><span·class="p">,</span>·<span·class="n">hue</span><span·class="o">=</span><span·class="s2">"z"</span><span·class="p">,</span>·<span·class="n">hue_style</span><span·class="o">=</span><span·class="s2">"discrete"</span><span·class="p">,</span>·<span·class="n">markersize</span><span·class="o">=</span><span·class="s2">"z"</span><span·class="p">)</span> |
1351 | <span·class="gh">Out[99]:·</span><span·class="go"></span> | 1351 | <span·class="gh">Out[99]:·</span><span·class="go"></span> |
1352 | <span·class="go">[<matplotlib.collections.PathCollection·at·0xffff5 | 1352 | <span·class="go">[<matplotlib.collections.PathCollection·at·0xffff585f61c0>,</span> |
1353 | <span·class="go">·<matplotlib.collections.PathCollection·at·0xffff | 1353 | <span·class="go">·<matplotlib.collections.PathCollection·at·0xffff40241640>,</span> |
1354 | <span·class="go">·<matplotlib.collections.PathCollection·at·0xffff | 1354 | <span·class="go">·<matplotlib.collections.PathCollection·at·0xffff68d013a0>,</span> |
1355 | <span·class="go">·<matplotlib.collections.PathCollection·at·0xffff | 1355 | <span·class="go">·<matplotlib.collections.PathCollection·at·0xffff40241e80>]</span> |
1356 | </pre></div> | 1356 | </pre></div> |
1357 | </div> | 1357 | </div> |
1358 | <img·alt="_images/ds_hue_size_scatter.png"·src="_images/ds_hue_size_scatter.png"·/> | 1358 | <img·alt="_images/ds_hue_size_scatter.png"·src="_images/ds_hue_size_scatter.png"·/> |
1359 | <p>Faceting·is·also·possible</p> | 1359 | <p>Faceting·is·also·possible</p> |
1360 | <div·class="highlight-ipython·notranslate"><div·class="highlight"><pre><span></span><span·class="gp">In·[100]:·</span><span·class="n">ds</span><span·class="o">.</span><span·class="n">plot</span><span·class="o">.</span><span·class="n">scatter</span><span·class="p">(</span><span·class="n">x</span><span·class="o">=</span><span·class="s2">"A"</span><span·class="p">,</span>·<span·class="n">y</span><span·class="o">=</span><span·class="s2">"B"</span><span·class="p">,</span>·<span·class="n">col</span><span·class="o">=</span><span·class="s2">"x"</span><span·class="p">,</span>·<span·class="n">row</span><span·class="o">=</span><span·class="s2">"z"</span><span·class="p">,</span>·<span·class="n">hue</span><span·class="o">=</span><span·class="s2">"w"</span><span·class="p">,</span>·<span·class="n">hue_style</span><span·class="o">=</span><span·class="s2">"discrete"</span><span·class="p">)</span> | 1360 | <div·class="highlight-ipython·notranslate"><div·class="highlight"><pre><span></span><span·class="gp">In·[100]:·</span><span·class="n">ds</span><span·class="o">.</span><span·class="n">plot</span><span·class="o">.</span><span·class="n">scatter</span><span·class="p">(</span><span·class="n">x</span><span·class="o">=</span><span·class="s2">"A"</span><span·class="p">,</span>·<span·class="n">y</span><span·class="o">=</span><span·class="s2">"B"</span><span·class="p">,</span>·<span·class="n">col</span><span·class="o">=</span><span·class="s2">"x"</span><span·class="p">,</span>·<span·class="n">row</span><span·class="o">=</span><span·class="s2">"z"</span><span·class="p">,</span>·<span·class="n">hue</span><span·class="o">=</span><span·class="s2">"w"</span><span·class="p">,</span>·<span·class="n">hue_style</span><span·class="o">=</span><span·class="s2">"discrete"</span><span·class="p">)</span> |
1361 | <span·class="gh">Out[100]:·</span><span·class="go"><xarray.plot.facetgrid.FacetGrid·at·0xffff | 1361 | <span·class="gh">Out[100]:·</span><span·class="go"><xarray.plot.facetgrid.FacetGrid·at·0xffff40100160></span> |
1362 | </pre></div> | 1362 | </pre></div> |
1363 | </div> | 1363 | </div> |
1364 | <img·alt="_images/ds_facet_scatter.png"·src="_images/ds_facet_scatter.png"·/> | 1364 | <img·alt="_images/ds_facet_scatter.png"·src="_images/ds_facet_scatter.png"·/> |
1365 | <p>For·more·advanced·scatter·plots,·we·recommend·converting·the·relevant·data·variables·to·a·pandas·DataFrame·and·using·the·extensive·plotting·capabilities·of·<code·class="docutils·literal·notranslate"><span·class="pre">seaborn</span></code>.</p> | 1365 | <p>For·more·advanced·scatter·plots,·we·recommend·converting·the·relevant·data·variables·to·a·pandas·DataFrame·and·using·the·extensive·plotting·capabilities·of·<code·class="docutils·literal·notranslate"><span·class="pre">seaborn</span></code>.</p> |
1366 | </div> | 1366 | </div> |
1367 | <div·class="section"·id="maps"> | 1367 | <div·class="section"·id="maps"> |
1368 | <span·id="plot-maps"></span><h2>Maps<a·class="headerlink"·href="#maps"·title="Permalink·to·this·headline">¶</a></h2> | 1368 | <span·id="plot-maps"></span><h2>Maps<a·class="headerlink"·href="#maps"·title="Permalink·to·this·headline">¶</a></h2> |
Offset 1380, 15 lines modified | Offset 1380, 15 lines modified | ||
1380 | <span·class="nn">/build/reproducible-path/python-xarray-0.16.2/xarray/tutorial.py</span>·in·<span·class="ni">open_dataset</span><span·class="nt">(name,·cache,·cache_dir,·github_url,·branch,·**kws)</span> | 1380 | <span·class="nn">/build/reproducible-path/python-xarray-0.16.2/xarray/tutorial.py</span>·in·<span·class="ni">open_dataset</span><span·class="nt">(name,·cache,·cache_dir,·github_url,·branch,·**kws)</span> |
1381 | <span·class="g·g-Whitespace">·····</span><span·class="mi">76</span>·········<span·class="c1">#·May·want·to·add·an·option·to·remove·it.</span> | 1381 | <span·class="g·g-Whitespace">·····</span><span·class="mi">76</span>·········<span·class="c1">#·May·want·to·add·an·option·to·remove·it.</span> |
1382 | <span·class="g·g-Whitespace">·····</span><span·class="mi">77</span>·········<span·class="k">if</span>·<span·class="ow">not</span>·<span·class="n">_os</span><span·class="o">.</span><span·class="n">path</span><span·class="o">.</span><span·class="n">isdir</span><span·class="p">(</span><span·class="n">longdir</span><span·class="p">):</span> | 1382 | <span·class="g·g-Whitespace">·····</span><span·class="mi">77</span>·········<span·class="k">if</span>·<span·class="ow">not</span>·<span·class="n">_os</span><span·class="o">.</span><span·class="n">path</span><span·class="o">.</span><span·class="n">isdir</span><span·class="p">(</span><span·class="n">longdir</span><span·class="p">):</span> |
1383 | <span·class="ne">--->·</span><span·class="mi">78</span>·············<span·class="n">_os</span><span·class="o">.</span><span·class="n">mkdir</span><span·class="p">(</span><span·class="n">longdir</span><span·class="p">)</span> | 1383 | <span·class="ne">--->·</span><span·class="mi">78</span>·············<span·class="n">_os</span><span·class="o">.</span><span·class="n">mkdir</span><span·class="p">(</span><span·class="n">longdir</span><span·class="p">)</span> |
1384 | <span·class="g·g-Whitespace">·····</span><span·class="mi">79</span>· | 1384 | <span·class="g·g-Whitespace">·····</span><span·class="mi">79</span>· |
1385 | <span·class="g·g-Whitespace">·····</span><span·class="mi">80</span>·········<span·class="n">url</span>·<span·class="o">=</span>·<span·class="s2">"/"</span><span·class="o">.</span><span·class="n">join</span><span·class="p">((</span><span·class="n">github_url</span><span·class="p">,</span>·<span·class="s2">"raw"</span><span·class="p">,</span>·<span·class="n">branch</span><span·class="p">,</span>·<span·class="n">fullname</span><span·class="p">))</span> | 1385 | <span·class="g·g-Whitespace">·····</span><span·class="mi">80</span>·········<span·class="n">url</span>·<span·class="o">=</span>·<span·class="s2">"/"</span><span·class="o">.</span><span·class="n">join</span><span·class="p">((</span><span·class="n">github_url</span><span·class="p">,</span>·<span·class="s2">"raw"</span><span·class="p">,</span>·<span·class="n">branch</span><span·class="p">,</span>·<span·class="n">fullname</span><span·class="p">))</span> |
1386 | <span·class="ne">FileNotFoundError</span>:·[Errno·2]·No·such·file·or·directory:·'/nonexistent/ | 1386 | <span·class="ne">FileNotFoundError</span>:·[Errno·2]·No·such·file·or·directory:·'/nonexistent/second-build/.xarray_tutorial_data' |
1387 | <span·class="gp">In·[103]:·</span><span·class="n">p</span>·<span·class="o">=</span>·<span·class="n">air</span><span·class="o">.</span><span·class="n">isel</span><span·class="p">(</span><span·class="n">time</span><span·class="o">=</span><span·class="mi">0</span><span·class="p">)</span><span·class="o">.</span><span·class="n">plot</span><span·class="p">(</span> | 1387 | <span·class="gp">In·[103]:·</span><span·class="n">p</span>·<span·class="o">=</span>·<span·class="n">air</span><span·class="o">.</span><span·class="n">isel</span><span·class="p">(</span><span·class="n">time</span><span·class="o">=</span><span·class="mi">0</span><span·class="p">)</span><span·class="o">.</span><span·class="n">plot</span><span·class="p">(</span> |
1388 | <span·class="gp">···.....:·</span>····<span·class="n">subplot_kws</span><span·class="o">=</span><span·class="nb">dict</span><span·class="p">(</span><span·class="n">projection</span><span·class="o">=</span><span·class="n">ccrs</span><span·class="o">.</span><span·class="n">Orthographic</span><span·class="p">(</span><span·class="o">-</span><span·class="mi">80</span><span·class="p">,</span>·<span·class="mi">35</span><span·class="p">),</span>·<span·class="n">facecolor</span><span·class="o">=</span><span·class="s2">"gray"</span><span·class="p">),</span> | 1388 | <span·class="gp">···.....:·</span>····<span·class="n">subplot_kws</span><span·class="o">=</span><span·class="nb">dict</span><span·class="p">(</span><span·class="n">projection</span><span·class="o">=</span><span·class="n">ccrs</span><span·class="o">.</span><span·class="n">Orthographic</span><span·class="p">(</span><span·class="o">-</span><span·class="mi">80</span><span·class="p">,</span>·<span·class="mi">35</span><span·class="p">),</span>·<span·class="n">facecolor</span><span·class="o">=</span><span·class="s2">"gray"</span><span·class="p">),</span> |
1389 | <span·class="gp">···.....:·</span>····<span·class="n">transform</span><span·class="o">=</span><span·class="n">ccrs</span><span·class="o">.</span><span·class="n">PlateCarree</span><span·class="p">(),</span> | 1389 | <span·class="gp">···.....:·</span>····<span·class="n">transform</span><span·class="o">=</span><span·class="n">ccrs</span><span·class="o">.</span><span·class="n">PlateCarree</span><span·class="p">(),</span> |
1390 | <span·class="gp">···.....:·</span><span·class="p">)</span> | 1390 | <span·class="gp">···.....:·</span><span·class="p">)</span> |
1391 | <span·class="gp">···.....:·</span> | 1391 | <span·class="gp">···.....:·</span> |
1392 | <span·class="gt">---------------------------------------------------------------------------</span> | 1392 | <span·class="gt">---------------------------------------------------------------------------</span> |
Offset 1472, 24 lines modified | Offset 1472, 24 lines modified | ||
1472 | <div·class="highlight-ipython·notranslate"><div·class="highlight"><pre><span></span><span·class="gp">In·[109]:·</span><span·class="kn">import</span>·<span·class="nn">xarray.plot</span>·<span·class="k">as</span>·<span·class="nn">xplt</span> | 1472 | <div·class="highlight-ipython·notranslate"><div·class="highlight"><pre><span></span><span·class="gp">In·[109]:·</span><span·class="kn">import</span>·<span·class="nn">xarray.plot</span>·<span·class="k">as</span>·<span·class="nn">xplt</span> |
1473 | <span·class="gp">In·[110]:·</span><span·class="n">da</span>·<span·class="o">=</span>·<span·class="n">xr</span><span·class="o">.</span><span·class="n">DataArray</span><span·class="p">(</span><span·class="nb">range</span><span·class="p">(</span><span·class="mi">5</span><span·class="p">))</span> | 1473 | <span·class="gp">In·[110]:·</span><span·class="n">da</span>·<span·class="o">=</span>·<span·class="n">xr</span><span·class="o">.</span><span·class="n">DataArray</span><span·class="p">(</span><span·class="nb">range</span><span·class="p">(</span><span·class="mi">5</span><span·class="p">))</span> |
1474 | <span·class="gp">In·[111]:·</span><span·class="n">fig</span><span·class="p">,</span>·<span·class="n">axes</span>·<span·class="o">=</span>·<span·class="n">plt</span><span·class="o">.</span><span·class="n">subplots</span><span·class="p">(</span><span·class="n">ncols</span><span·class="o">=</span><span·class="mi">2</span><span·class="p">,</span>·<span·class="n">nrows</span><span·class="o">=</span><span·class="mi">2</span><span·class="p">)</span> | 1474 | <span·class="gp">In·[111]:·</span><span·class="n">fig</span><span·class="p">,</span>·<span·class="n">axes</span>·<span·class="o">=</span>·<span·class="n">plt</span><span·class="o">.</span><span·class="n">subplots</span><span·class="p">(</span><span·class="n">ncols</span><span·class="o">=</span><span·class="mi">2</span><span·class="p">,</span>·<span·class="n">nrows</span><span·class="o">=</span><span·class="mi">2</span><span·class="p">)</span> |
1475 | <span·class="gp">In·[112]:·</span><span·class="n">da</span><span·class="o">.</span><span·class="n">plot</span><span·class="p">(</span><span·class="n">ax</span><span·class="o">=</span><span·class="n">axes</span><span·class="p">[</span><span·class="mi">0</span><span·class="p">,</span>·<span·class="mi">0</span><span·class="p">])</span> | 1475 | <span·class="gp">In·[112]:·</span><span·class="n">da</span><span·class="o">.</span><span·class="n">plot</span><span·class="p">(</span><span·class="n">ax</span><span·class="o">=</span><span·class="n">axes</span><span·class="p">[</span><span·class="mi">0</span><span·class="p">,</span>·<span·class="mi">0</span><span·class="p">])</span> |
1476 | <span·class="gh">Out[112]:·</span><span·class="go">[<matplotlib.lines.Line2D·at·0xffff | 1476 | <span·class="gh">Out[112]:·</span><span·class="go">[<matplotlib.lines.Line2D·at·0xffff2b6d8df0>]</span> |
1477 | <span·class="gp">In·[113]:·</span><span·class="n">da</span><span·class="o">.</span><span·class="n">plot</span><span·class="o">.</span><span·class="n">line</span><span·class="p">(</span><span·class="n">ax</span><span·class="o">=</span><span·class="n">axes</span><span·class="p">[</span><span·class="mi">0</span><span·class="p">,</span>·<span·class="mi">1</span><span·class="p">])</span> | 1477 | <span·class="gp">In·[113]:·</span><span·class="n">da</span><span·class="o">.</span><span·class="n">plot</span><span·class="o">.</span><span·class="n">line</span><span·class="p">(</span><span·class="n">ax</span><span·class="o">=</span><span·class="n">axes</span><span·class="p">[</span><span·class="mi">0</span><span·class="p">,</span>·<span·class="mi">1</span><span·class="p">])</span> |
1478 | <span·class="gh">Out[113]:·</span><span·class="go">[<matplotlib.lines.Line2D·at·0xffff | 1478 | <span·class="gh">Out[113]:·</span><span·class="go">[<matplotlib.lines.Line2D·at·0xffff82dc2af0>]</span> |
1479 | <span·class="gp">In·[114]:·</span><span·class="n">xplt</span><span·class="o">.</span><span·class="n">plot</span><span·class="p">(</span><span·class="n">da</span><span·class="p">,</span>·<span·class="n">ax</span><span·class="o">=</span><span·class="n">axes</span><span·class="p">[</span><span·class="mi">1</span><span·class="p">,</span>·<span·class="mi">0</span><span·class="p">])</span> | 1479 | <span·class="gp">In·[114]:·</span><span·class="n">xplt</span><span·class="o">.</span><span·class="n">plot</span><span·class="p">(</span><span·class="n">da</span><span·class="p">,</span>·<span·class="n">ax</span><span·class="o">=</span><span·class="n">axes</span><span·class="p">[</span><span·class="mi">1</span><span·class="p">,</span>·<span·class="mi">0</span><span·class="p">])</span> |
1480 | <span·class="gh">Out[114]:·</span><span·class="go">[<matplotlib.lines.Line2D·at·0xffff | 1480 | <span·class="gh">Out[114]:·</span><span·class="go">[<matplotlib.lines.Line2D·at·0xffff2b6d8430>]</span> |
1481 | <span·class="gp">In·[115]:·</span><span·class="n">xplt</span><span·class="o">.</span><span·class="n">line</span><span·class="p">(</span><span·class="n">da</span><span·class="p">,</span>·<span·class="n">ax</span><span·class="o">=</span><span·class="n">axes</span><span·class="p">[</span><span·class="mi">1</span><span·class="p">,</span>·<span·class="mi">1</span><span·class="p">])</span> | 1481 | <span·class="gp">In·[115]:·</span><span·class="n">xplt</span><span·class="o">.</span><span·class="n">line</span><span·class="p">(</span><span·class="n">da</span><span·class="p">,</span>·<span·class="n">ax</span><span·class="o">=</span><span·class="n">axes</span><span·class="p">[</span><span·class="mi">1</span><span·class="p">,</span>·<span·class="mi">1</span><span·class="p">])</span> |
1482 | <span·class="gh">Out[115]:·</span><span·class="go">[<matplotlib.lines.Line2D·at·0xffff | 1482 | <span·class="gh">Out[115]:·</span><span·class="go">[<matplotlib.lines.Line2D·at·0xffff2b663dc0>]</span> |
1483 | <span·class="gp">In·[116]:·</span><span·class="n">plt</span><span·class="o">.</span><span·class="n">tight_layout</span><span·class="p">()</span> | 1483 | <span·class="gp">In·[116]:·</span><span·class="n">plt</span><span·class="o">.</span><span·class="n">tight_layout</span><span·class="p">()</span> |
1484 | <span·class="gp">In·[117]:·</span><span·class="n">plt</span><span·class="o">.</span><span·class="n">draw</span><span·class="p">()</span> | 1484 | <span·class="gp">In·[117]:·</span><span·class="n">plt</span><span·class="o">.</span><span·class="n">draw</span><span·class="p">()</span> |
Max diff block lines reached; 14095/34448 bytes (40.92%) of diff not shown. |
Offset 121, 15 lines modified | Offset 121, 15 lines modified | ||
121 | open_dataset(name,·cache,·cache_dir,·github_url,·branch,·**kws) | 121 | open_dataset(name,·cache,·cache_dir,·github_url,·branch,·**kws) |
122 | ·····76·········#·May·want·to·add·an·option·to·remove·it. | 122 | ·····76·········#·May·want·to·add·an·option·to·remove·it. |
123 | ·····77·········if·not·_os.path.isdir(longdir): | 123 | ·····77·········if·not·_os.path.isdir(longdir): |
124 | --->·78·············_os.mkdir(longdir) | 124 | --->·78·············_os.mkdir(longdir) |
125 | ·····79 | 125 | ·····79 |
126 | ·····80·········url·=·"/".join((github_url,·"raw",·branch,·fullname)) | 126 | ·····80·········url·=·"/".join((github_url,·"raw",·branch,·fullname)) |
127 | FileNotFoundError:·[Errno·2]·No·such·file·or·directory:·'/nonexistent/ | 127 | FileNotFoundError:·[Errno·2]·No·such·file·or·directory:·'/nonexistent/second- |
128 | build/.xarray_tutorial_data' | 128 | build/.xarray_tutorial_data' |
129 | In·[6]:·airtemps | 129 | In·[6]:·airtemps |
130 | --------------------------------------------------------------------------- | 130 | --------------------------------------------------------------------------- |
131 | NameError·································Traceback·(most·recent·call·last) | 131 | NameError·································Traceback·(most·recent·call·last) |
132 | <ipython-input-6-eb57b540ddce>·in·<module> | 132 | <ipython-input-6-eb57b540ddce>·in·<module> |
133 | ---->·1·airtemps | 133 | ---->·1·airtemps |
Offset 588, 15 lines modified | Offset 588, 15 lines modified | ||
588 | -->·171·········ref_var·=·variables[ref_name] | 588 | -->·171·········ref_var·=·variables[ref_name] |
589 | ····172 | 589 | ····172 |
590 | ····173·····if·var_name·is·None: | 590 | ····173·····if·var_name·is·None: |
591 | KeyError:·'lat' | 591 | KeyError:·'lat' |
592 | In·[51]:·b.plot() | 592 | In·[51]:·b.plot() |
593 | Out[51]:·[<matplotlib.lines.Line2D·at·0xffff | 593 | Out[51]:·[<matplotlib.lines.Line2D·at·0xffff40184d00>] |
594 | [_images/plotting_nonuniform_coords.png] | 594 | [_images/plotting_nonuniform_coords.png] |
595 | ***·Calling·Matplotlib¶·*** | 595 | ***·Calling·Matplotlib¶·*** |
596 | Since·this·is·a·thin·wrapper·around·matplotlib,·all·the·functionality·of | 596 | Since·this·is·a·thin·wrapper·around·matplotlib,·all·the·functionality·of |
597 | matplotlib·is·available. | 597 | matplotlib·is·available. |
598 | In·[52]:·air2d.plot(cmap=plt.cm.Blues) | 598 | In·[52]:·air2d.plot(cmap=plt.cm.Blues) |
599 | --------------------------------------------------------------------------- | 599 | --------------------------------------------------------------------------- |
600 | NameError·································Traceback·(most·recent·call·last) | 600 | NameError·································Traceback·(most·recent·call·last) |
Offset 984, 53 lines modified | Offset 984, 53 lines modified | ||
984 | ··*·z········(z)·int64·0·1·2·3 | 984 | ··*·z········(z)·int64·0·1·2·3 |
985 | ··*·w········(w)·<U5·'one'·'two'·'three'·'five' | 985 | ··*·w········(w)·<U5·'one'·'two'·'three'·'five' |
986 | Data·variables: | 986 | Data·variables: |
987 | ····A········(x,·y,·z,·w)·float64·-0.104·0.02719·-0.0425·...·-0.1175·-0.0183 | 987 | ····A········(x,·y,·z,·w)·float64·-0.104·0.02719·-0.0425·...·-0.1175·-0.0183 |
988 | ····B········(x,·y,·z,·w)·float64·0.0·0.0·0.0·0.0·...·1.369·1.408·1.387·1.417 | 988 | ····B········(x,·y,·z,·w)·float64·0.0·0.0·0.0·0.0·...·1.369·1.408·1.387·1.417 |
989 | Suppose·we·want·to·scatter·A·against·B | 989 | Suppose·we·want·to·scatter·A·against·B |
990 | In·[95]:·ds.plot.scatter(x="A",·y="B") | 990 | In·[95]:·ds.plot.scatter(x="A",·y="B") |
991 | Out[95]:·<matplotlib.collections.PathCollection·at·0xffff | 991 | Out[95]:·<matplotlib.collections.PathCollection·at·0xffff402f9580> |
992 | [_images/ds_simple_scatter.png] | 992 | [_images/ds_simple_scatter.png] |
993 | The·hue·kwarg·lets·you·vary·the·color·by·variable·value | 993 | The·hue·kwarg·lets·you·vary·the·color·by·variable·value |
994 | In·[96]:·ds.plot.scatter(x="A",·y="B",·hue="w") | 994 | In·[96]:·ds.plot.scatter(x="A",·y="B",·hue="w") |
995 | Out[96]: | 995 | Out[96]: |
996 | [<matplotlib.collections.PathCollection·at·0xffff682bbe80>, | ||
996 | 997 | ·<matplotlib.collections.PathCollection·at·0xffff688c7100>, | |
997 | ·<matplotlib.collections.PathCollection·at·0xffff6c | 998 | ·<matplotlib.collections.PathCollection·at·0xffff6acc2df0>, |
998 | ·<matplotlib.collections.PathCollection·at·0xffff6c3df6d0>, | ||
999 | ·<matplotlib.collections.PathCollection·at·0xffff | 999 | ·<matplotlib.collections.PathCollection·at·0xffff6812a580>] |
1000 | [_images/ds_hue_scatter.png] | 1000 | [_images/ds_hue_scatter.png] |
1001 | When·hue·is·specified,·a·colorbar·is·added·for·numeric·hue·DataArrays·by | 1001 | When·hue·is·specified,·a·colorbar·is·added·for·numeric·hue·DataArrays·by |
1002 | default·and·a·legend·is·added·for·non-numeric·hue·DataArrays·(as·above).·You | 1002 | default·and·a·legend·is·added·for·non-numeric·hue·DataArrays·(as·above).·You |
1003 | can·force·a·legend·instead·of·a·colorbar·by·setting·hue_style='discrete'. | 1003 | can·force·a·legend·instead·of·a·colorbar·by·setting·hue_style='discrete'. |
1004 | Additionally,·the·boolean·kwarg·add_guide·can·be·used·to·prevent·the·display·of | 1004 | Additionally,·the·boolean·kwarg·add_guide·can·be·used·to·prevent·the·display·of |
1005 | a·legend·or·colorbar·(as·appropriate). | 1005 | a·legend·or·colorbar·(as·appropriate). |
1006 | In·[97]:·ds·=·ds.assign(w=[1,·2,·3,·5]) | 1006 | In·[97]:·ds·=·ds.assign(w=[1,·2,·3,·5]) |
1007 | In·[98]:·ds.plot.scatter(x="A",·y="B",·hue="w",·hue_style="discrete") | 1007 | In·[98]:·ds.plot.scatter(x="A",·y="B",·hue="w",·hue_style="discrete") |
1008 | Out[98]: | 1008 | Out[98]: |
1009 | [<matplotlib.collections.PathCollection·at·0xffff6 | 1009 | [<matplotlib.collections.PathCollection·at·0xffff68277040>, |
1010 | ·<matplotlib.collections.PathCollection·at·0xffff | 1010 | ·<matplotlib.collections.PathCollection·at·0xffff582932b0>, |
1011 | ·<matplotlib.collections.PathCollection·at·0xffff | 1011 | ·<matplotlib.collections.PathCollection·at·0xffff5836ff10>, |
1012 | ·<matplotlib.collections.PathCollection·at·0xffff6 | 1012 | ·<matplotlib.collections.PathCollection·at·0xffff690cc430>] |
1013 | [_images/ds_discrete_legend_hue_scatter.png] | 1013 | [_images/ds_discrete_legend_hue_scatter.png] |
1014 | The·markersize·kwarg·lets·you·vary·the·pointâs·size·by·variable·value.·You | 1014 | The·markersize·kwarg·lets·you·vary·the·pointâs·size·by·variable·value.·You |
1015 | can·additionally·pass·size_norm·to·control·how·the·variableâs·values·are | 1015 | can·additionally·pass·size_norm·to·control·how·the·variableâs·values·are |
1016 | mapped·to·point·sizes. | 1016 | mapped·to·point·sizes. |
1017 | In·[99]:·ds.plot.scatter(x="A",·y="B",·hue="z",·hue_style="discrete", | 1017 | In·[99]:·ds.plot.scatter(x="A",·y="B",·hue="z",·hue_style="discrete", |
1018 | markersize="z") | 1018 | markersize="z") |
1019 | Out[99]: | 1019 | Out[99]: |
1020 | [<matplotlib.collections.PathCollection·at·0xffff5 | 1020 | [<matplotlib.collections.PathCollection·at·0xffff585f61c0>, |
1021 | ·<matplotlib.collections.PathCollection·at·0xffff | 1021 | ·<matplotlib.collections.PathCollection·at·0xffff40241640>, |
1022 | ·<matplotlib.collections.PathCollection·at·0xffff | 1022 | ·<matplotlib.collections.PathCollection·at·0xffff68d013a0>, |
1023 | ·<matplotlib.collections.PathCollection·at·0xffff | 1023 | ·<matplotlib.collections.PathCollection·at·0xffff40241e80>] |
1024 | [_images/ds_hue_size_scatter.png] | 1024 | [_images/ds_hue_size_scatter.png] |
1025 | Faceting·is·also·possible | 1025 | Faceting·is·also·possible |
1026 | In·[100]:·ds.plot.scatter(x="A",·y="B",·col="x",·row="z",·hue="w", | 1026 | In·[100]:·ds.plot.scatter(x="A",·y="B",·col="x",·row="z",·hue="w", |
1027 | hue_style="discrete") | 1027 | hue_style="discrete") |
1028 | Out[100]:·<xarray.plot.facetgrid.FacetGrid·at·0xffff | 1028 | Out[100]:·<xarray.plot.facetgrid.FacetGrid·at·0xffff40100160> |
1029 | [_images/ds_facet_scatter.png] | 1029 | [_images/ds_facet_scatter.png] |
1030 | For·more·advanced·scatter·plots,·we·recommend·converting·the·relevant·data | 1030 | For·more·advanced·scatter·plots,·we·recommend·converting·the·relevant·data |
1031 | variables·to·a·pandas·DataFrame·and·using·the·extensive·plotting·capabilities | 1031 | variables·to·a·pandas·DataFrame·and·using·the·extensive·plotting·capabilities |
1032 | of·seaborn. | 1032 | of·seaborn. |
1033 | *****·Maps¶·***** | 1033 | *****·Maps¶·***** |
1034 | To·follow·this·section·youâll·need·to·have·Cartopy·installed·and·working. | 1034 | To·follow·this·section·youâll·need·to·have·Cartopy·installed·and·working. |
1035 | This·script·will·plot·the·air·temperature·on·a·map. | 1035 | This·script·will·plot·the·air·temperature·on·a·map. |
Offset 1046, 15 lines modified | Offset 1046, 15 lines modified | ||
1046 | open_dataset(name,·cache,·cache_dir,·github_url,·branch,·**kws) | 1046 | open_dataset(name,·cache,·cache_dir,·github_url,·branch,·**kws) |
1047 | ·····76·········#·May·want·to·add·an·option·to·remove·it. | 1047 | ·····76·········#·May·want·to·add·an·option·to·remove·it. |
1048 | ·····77·········if·not·_os.path.isdir(longdir): | 1048 | ·····77·········if·not·_os.path.isdir(longdir): |
1049 | --->·78·············_os.mkdir(longdir) | 1049 | --->·78·············_os.mkdir(longdir) |
1050 | ·····79 | 1050 | ·····79 |
1051 | ·····80·········url·=·"/".join((github_url,·"raw",·branch,·fullname)) | 1051 | ·····80·········url·=·"/".join((github_url,·"raw",·branch,·fullname)) |
1052 | FileNotFoundError:·[Errno·2]·No·such·file·or·directory:·'/nonexistent/ | 1052 | FileNotFoundError:·[Errno·2]·No·such·file·or·directory:·'/nonexistent/second- |
1053 | build/.xarray_tutorial_data' | 1053 | build/.xarray_tutorial_data' |
1054 | In·[103]:·p·=·air.isel(time=0).plot( | 1054 | In·[103]:·p·=·air.isel(time=0).plot( |
1055 | ···.....:·····subplot_kws=dict(projection=ccrs.Orthographic(-80,·35), | 1055 | ···.....:·····subplot_kws=dict(projection=ccrs.Orthographic(-80,·35), |
1056 | facecolor="gray"), | 1056 | facecolor="gray"), |
1057 | ···.....:·····transform=ccrs.PlateCarree(), | 1057 | ···.....:·····transform=ccrs.PlateCarree(), |
1058 | ···.....:·) | 1058 | ···.....:·) |
Offset 1131, 24 lines modified | Offset 1131, 24 lines modified | ||
1131 | In·[109]:·import·xarray.plot·as·xplt | 1131 | In·[109]:·import·xarray.plot·as·xplt |
1132 | In·[110]:·da·=·xr.DataArray(range(5)) | 1132 | In·[110]:·da·=·xr.DataArray(range(5)) |
1133 | In·[111]:·fig,·axes·=·plt.subplots(ncols=2,·nrows=2) | 1133 | In·[111]:·fig,·axes·=·plt.subplots(ncols=2,·nrows=2) |
1134 | In·[112]:·da.plot(ax=axes[0,·0]) | 1134 | In·[112]:·da.plot(ax=axes[0,·0]) |
1135 | Out[112]:·[<matplotlib.lines.Line2D·at·0xffff | 1135 | Out[112]:·[<matplotlib.lines.Line2D·at·0xffff2b6d8df0>] |
1136 | In·[113]:·da.plot.line(ax=axes[0,·1]) | 1136 | In·[113]:·da.plot.line(ax=axes[0,·1]) |
1137 | Out[113]:·[<matplotlib.lines.Line2D·at·0xffff | 1137 | Out[113]:·[<matplotlib.lines.Line2D·at·0xffff82dc2af0>] |
1138 | In·[114]:·xplt.plot(da,·ax=axes[1,·0]) | 1138 | In·[114]:·xplt.plot(da,·ax=axes[1,·0]) |
1139 | Out[114]:·[<matplotlib.lines.Line2D·at·0xffff | 1139 | Out[114]:·[<matplotlib.lines.Line2D·at·0xffff2b6d8430>] |
1140 | In·[115]:·xplt.line(da,·ax=axes[1,·1]) | 1140 | In·[115]:·xplt.line(da,·ax=axes[1,·1]) |
1141 | Out[115]:·[<matplotlib.lines.Line2D·at·0xffff | 1141 | Out[115]:·[<matplotlib.lines.Line2D·at·0xffff2b663dc0>] |
1142 | In·[116]:·plt.tight_layout() | 1142 | In·[116]:·plt.tight_layout() |
1143 | In·[117]:·plt.draw() | 1143 | In·[117]:·plt.draw() |
1144 | [_images/plotting_ways_to_use.png] | 1144 | [_images/plotting_ways_to_use.png] |
1145 | Here·the·output·is·the·same.·Since·the·data·is·1·dimensional·the·line·plot·was | 1145 | Here·the·output·is·the·same.·Since·the·data·is·1·dimensional·the·line·plot·was |
1146 | used. | 1146 | used. |
Max diff block lines reached; 5079/11682 bytes (43.48%) of diff not shown. |
Offset 498, 15 lines modified | Offset 498, 15 lines modified | ||
498 | </pre></div> | 498 | </pre></div> |
499 | </div> | 499 | </div> |
500 | </div> | 500 | </div> |
501 | <div·class="section"·id="plotting"> | 501 | <div·class="section"·id="plotting"> |
502 | <h2>Plotting<a·class="headerlink"·href="#plotting"·title="Permalink·to·this·headline">¶</a></h2> | 502 | <h2>Plotting<a·class="headerlink"·href="#plotting"·title="Permalink·to·this·headline">¶</a></h2> |
503 | <p>Visualizing·your·datasets·is·quick·and·convenient:</p> | 503 | <p>Visualizing·your·datasets·is·quick·and·convenient:</p> |
504 | <div·class="highlight-ipython·notranslate"><div·class="highlight"><pre><span></span><span·class="gp">In·[37]:·</span><span·class="n">data</span><span·class="o">.</span><span·class="n">plot</span><span·class="p">()</span> | 504 | <div·class="highlight-ipython·notranslate"><div·class="highlight"><pre><span></span><span·class="gp">In·[37]:·</span><span·class="n">data</span><span·class="o">.</span><span·class="n">plot</span><span·class="p">()</span> |
505 | <span·class="gh">Out[37]:·</span><span·class="go"><matplotlib.collections.QuadMesh·at·0xffff | 505 | <span·class="gh">Out[37]:·</span><span·class="go"><matplotlib.collections.QuadMesh·at·0xffff2b1f8610></span> |
506 | </pre></div> | 506 | </pre></div> |
507 | </div> | 507 | </div> |
508 | <img·alt="_images/plotting_quick_overview.png"·src="_images/plotting_quick_overview.png"·/> | 508 | <img·alt="_images/plotting_quick_overview.png"·src="_images/plotting_quick_overview.png"·/> |
509 | <p>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·<a·class="reference·internal"·href="plotting.html#plotting"><span·class="std·std-ref">Plotting</span></a>.</p> | 509 | <p>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·<a·class="reference·internal"·href="plotting.html#plotting"><span·class="std·std-ref">Plotting</span></a>.</p> |
510 | </div> | 510 | </div> |
511 | <div·class="section"·id="pandas"> | 511 | <div·class="section"·id="pandas"> |
512 | <h2>pandas<a·class="headerlink"·href="#pandas"·title="Permalink·to·this·headline">¶</a></h2> | 512 | <h2>pandas<a·class="headerlink"·href="#pandas"·title="Permalink·to·this·headline">¶</a></h2> |
Offset 304, 15 lines modified | Offset 304, 15 lines modified | ||
304 | ·······[0.787,·0.···,·1.199]]) | 304 | ·······[0.787,·0.···,·1.199]]) |
305 | Coordinates: | 305 | Coordinates: |
306 | ··*·x········(x)·int64·10·20 | 306 | ··*·x········(x)·int64·10·20 |
307 | Dimensions·without·coordinates:·y | 307 | Dimensions·without·coordinates:·y |
308 | *****·Plotting¶·***** | 308 | *****·Plotting¶·***** |
309 | Visualizing·your·datasets·is·quick·and·convenient: | 309 | Visualizing·your·datasets·is·quick·and·convenient: |
310 | In·[37]:·data.plot() | 310 | In·[37]:·data.plot() |
311 | Out[37]:·<matplotlib.collections.QuadMesh·at·0xffff | 311 | Out[37]:·<matplotlib.collections.QuadMesh·at·0xffff2b1f8610> |
312 | [_images/plotting_quick_overview.png] | 312 | [_images/plotting_quick_overview.png] |
313 | Note·the·automatic·labeling·with·names·and·units.·Our·effort·in·adding·metadata | 313 | Note·the·automatic·labeling·with·names·and·units.·Our·effort·in·adding·metadata |
314 | attributes·has·paid·off!·Many·aspects·of·these·figures·are·customizable:·see | 314 | attributes·has·paid·off!·Many·aspects·of·these·figures·are·customizable:·see |
315 | Plotting. | 315 | Plotting. |
316 | *****·pandas¶·***** | 316 | *****·pandas¶·***** |
317 | Xarray·objects·can·be·easily·converted·to·and·from·pandas·objects·using·the | 317 | Xarray·objects·can·be·easily·converted·to·and·from·pandas·objects·using·the |
318 | to_series(),·to_dataframe()·and·to_xarray()·methods: | 318 | to_series(),·to_dataframe()·and·to_xarray()·methods: |
Offset 76, 15 lines modified | Offset 76, 14 lines modified | ||
76 | ········"03642301":·4, | 76 | ········"03642301":·4, |
77 | ········"037":·17, | 77 | ········"037":·17, |
78 | ········"037369":·17, | 78 | ········"037369":·17, |
79 | ········"03736932":·17, | 79 | ········"03736932":·17, |
80 | ········"0379266750948":·26, | 80 | ········"0379266750948":·26, |
81 | ········"038":·22, | 81 | ········"038":·22, |
82 | ········"039":·29, | 82 | ········"039":·29, |
83 | ········"03d2aeb5":·26, | ||
84 | ········"03e":·26, | 83 | ········"03e":·26, |
85 | ········"03t00":·[6,·7,·17], | 84 | ········"03t00":·[6,·7,·17], |
86 | ········"040347":·17, | 85 | ········"040347":·17, |
87 | ········"041":·7, | 86 | ········"041":·7, |
88 | ········"0417827":·26, | 87 | ········"0417827":·26, |
89 | ········"041782729805":·26, | 88 | ········"041782729805":·26, |
90 | ········"0425":·28, | 89 | ········"0425":·28, |
Offset 152, 70 lines modified | Offset 151, 70 lines modified | ||
152 | ········"0alpha10":·36, | 151 | ········"0alpha10":·36, |
153 | ········"0c0dc80c25a9":·6, | 152 | ········"0c0dc80c25a9":·6, |
154 | ········"0e8985178ccc":·26, | 153 | ········"0e8985178ccc":·26, |
155 | ········"0eb806e38f7f":·[14,·15], | 154 | ········"0eb806e38f7f":·[14,·15], |
156 | ········"0f41191e8013":·28, | 155 | ········"0f41191e8013":·28, |
157 | ········"0th":·[6,·22], | 156 | ········"0th":·[6,·22], |
158 | ········"0x0l":·36, | 157 | ········"0x0l":·36, |
159 | ········"0xffff | 158 | ········"0xffff2a3553d0":·36, |
160 | ········"0xffff | 159 | ········"0xffff2b1f8610":·29, |
161 | ········"0xffff56882160":·28, | ||
162 | ········"0xffff56882400":·28, | ||
163 | ········"0xffff56882460":·28, | ||
164 | ········"0xffff | 160 | ········"0xffff2b292220":·28, |
165 | ········"0xffff56882670":·28, | ||
166 | ········"0xffff5695ad30":·28, | ||
167 | ········"0xffff5695ad60":·28, | ||
168 | ········"0xffff56c54dc0":·28, | ||
169 | ········"0xffff56c8f5b0":·28, | ||
170 | ········"0xffff56cd5940":·28, | ||
171 | ········"0xffff56cd5e80":·28, | ||
172 | ········"0xffff56cea4f0":·28, | ||
173 | ········"0xffff56d1a8b0":·28, | ||
174 | ········"0xffff56d273a0":·28, | ||
175 | ········"0xffff56f20520":·28, | ||
176 | ········"0xffff56f524c0":·28, | ||
177 | ········"0xffff56f5dd30":·28, | ||
178 | ········"0xffff56f8dc70":·28, | ||
179 | ········"0xffff570bd760":·28, | ||
180 | ········"0xffff570e7760":·28, | ||
181 | ········"0xffff570f30a0":·28, | ||
182 | ········"0xffff57521cd0":·28, | ||
183 | ········"0xffff | 161 | ········"0xffff2b292b80":·28, |
162 | ········"0xffff2b292be0":·28, | ||
184 | ········"0xffff | 163 | ········"0xffff2b292d30":·28, |
164 | ········"0xffff2b292df0":·28, | ||
165 | ········"0xffff2b376730":·28, | ||
166 | ········"0xffff2b3ac790":·28, | ||
185 | ········"0xffff | 167 | ········"0xffff2b3acc70":·28, |
168 | ········"0xffff2b663dc0":·28, | ||
169 | ········"0xffff2b6d8430":·28, | ||
170 | ········"0xffff2b6d8df0":·28, | ||
171 | ········"0xffff2b731700":·28, | ||
172 | ········"0xffff40067fa0":·28, | ||
173 | ········"0xffff40100160":·28, | ||
186 | ········"0xffff | 174 | ········"0xffff40184d00":·28, |
187 | ········"0xffff | 175 | ········"0xffff40241640":·28, |
176 | ········"0xffff40241e80":·28, | ||
177 | ········"0xffff402ea850":·28, | ||
178 | ········"0xffff402f9580":·28, | ||
188 | ········"0xffff | 179 | ········"0xffff4074e1c0":·26, |
189 | ········"0xffff | 180 | ········"0xffff4074e520":·26, |
181 | ········"0xffff4074e700":·26, | ||
182 | ········"0xffff4074eac0":·26, | ||
190 | ········"0xffff | 183 | ········"0xffff4074ee80":·26, |
191 | ········"0xffff | 184 | ········"0xffff4074efa0":·26, |
192 | ········"0xffff | 185 | ········"0xffff4077d280":·25, |
193 | ········"0xffff | 186 | ········"0xffff40782490":·25, |
187 | ········"0xffff407980a0":·25, | ||
194 | ········"0xffff | 188 | ········"0xffff40798400":·25, |
195 | ········"0xffff5 | 189 | ········"0xffff58045520":·24, |
196 | ········"0xffff | 190 | ········"0xffff582932b0":·28, |
197 | ········"0xffff | 191 | ········"0xffff582934f0":·28, |
198 | ········"0xffff6c0b6af0":·28, | ||
199 | ········"0xffff6c0e0250":·28, | ||
200 | ········"0xffff6c0ef160":·28, | ||
201 | ········"0xffff | 192 | ········"0xffff58293af0":·28, |
193 | ········"0xffff5836ff10":·28, | ||
194 | ········"0xffff58589b20":·28, | ||
195 | ········"0xffff585f61c0":·28, | ||
196 | ········"0xffff6812a580":·28, | ||
197 | ········"0xffff68277040":·28, | ||
198 | ········"0xffff682bbe80":·28, | ||
199 | ········"0xffff688c7100":·28, | ||
200 | ········"0xffff689d4fa0":·7, | ||
201 | ········"0xffff689df2e0":·7, | ||
202 | ········"0xffff68a71340":·26, | ||
203 | ········"0xffff68d013a0":·28, | ||
204 | ········"0xffff690cc430":·28, | ||
202 | ········"0xffff6c | 205 | ········"0xffff6acc2df0":·28, |
203 | ········"0xffff6c7d9760":·28, | ||
204 | ········"0xffff6c7d9f70":·28, | ||
205 | ········"0xffff7 | 206 | ········"0xffff787868b0":·16, |
207 | ········"0xffff82dc2af0":·28, | ||
208 | ········"0xffff82de7610":·28, | ||
209 | ········"0xffff82ef1d90":·28, | ||
210 | ········"0xffff82f86130":·28, | ||
206 | ········"0xffff886 | 211 | ········"0xffff82f865e0":·28, |
207 | ········"0xffff886611c0":·7, | ||
208 | ········"0xffff8 | 212 | ········"0xffff82fd67c0":·28, |
209 | ········"0xffff9 | 213 | ········"0xffff9745ecd0":·17, |
210 | ········"0xffffae3e6c70":·28, | ||
211 | ········"0xffffae50ca30":·28, | ||
212 | ········"0xffffae50cf10":·28, | ||
213 | ········"0xffffae57e3d0":·28, | ||
214 | ········"0xffffae57ea00":·28, | ||
215 | ········"100":·[3,·4,·6,·11,·12,·22,·25,·26,·28,·31,·36], | 214 | ········"100":·[3,·4,·6,·11,·12,·22,·25,·26,·28,·31,·36], |
216 | ········"1000":·[6,·36], | 215 | ········"1000":·[6,·36], |
217 | ········"100000":·6, | 216 | ········"100000":·6, |
218 | ········"1000x1000":·6, | 217 | ········"1000x1000":·6, |
219 | ········"1003":·4, | 218 | ········"1003":·4, |
220 | ········"101":·[4,·22,·28,·36], | 219 | ········"101":·[4,·22,·28,·36], |
221 | ········"101985":·26, | 220 | ········"101985":·26, |
Offset 522, 14 lines modified | Offset 521, 15 lines modified | ||
522 | ········"2748":·10, | 521 | ········"2748":·10, |
523 | ········"27483458":·4, | 522 | ········"27483458":·4, |
524 | ········"2749":·10, | 523 | ········"2749":·10, |
525 | ········"275":·[7,·16,·22], | 524 | ········"275":·[7,·16,·22], |
526 | ········"276":·29, | 525 | ········"276":·29, |
527 | ········"2762":·29, | 526 | ········"2762":·29, |
528 | ········"276232":·29, | 527 | ········"276232":·29, |
528 | ········"277162681b3377c87ddac5999bf33daetemperatur":·6, | ||
Max diff block lines reached; 4514/9037 bytes (49.95%) of diff not shown. |
Offset 4447, 15 lines modified | Offset 4447, 15 lines modified | ||
4447 | <li><p>New·<code·class="docutils·literal·notranslate"><span·class="pre">xray.Dataset.where</span></code>·method·for·masking·xray·objects·according | 4447 | <li><p>New·<code·class="docutils·literal·notranslate"><span·class="pre">xray.Dataset.where</span></code>·method·for·masking·xray·objects·according |
4448 | to·some·criteria.·This·works·particularly·well·with·multi-dimensional·data:</p> | 4448 | to·some·criteria.·This·works·particularly·well·with·multi-dimensional·data:</p> |
4449 | <div·class="highlight-ipython·notranslate"><div·class="highlight"><pre><span></span><span·class="gp">In·[44]:·</span><span·class="n">ds</span>·<span·class="o">=</span>·<span·class="n">xray</span><span·class="o">.</span><span·class="n">Dataset</span><span·class="p">(</span><span·class="n">coords</span><span·class="o">=</span><span·class="p">{</span><span·class="s2">"x"</span><span·class="p">:</span>·<span·class="nb">range</span><span·class="p">(</span><span·class="mi">100</span><span·class="p">),</span>·<span·class="s2">"y"</span><span·class="p">:</span>·<span·class="nb">range</span><span·class="p">(</span><span·class="mi">100</span><span·class="p">)})</span> | 4449 | <div·class="highlight-ipython·notranslate"><div·class="highlight"><pre><span></span><span·class="gp">In·[44]:·</span><span·class="n">ds</span>·<span·class="o">=</span>·<span·class="n">xray</span><span·class="o">.</span><span·class="n">Dataset</span><span·class="p">(</span><span·class="n">coords</span><span·class="o">=</span><span·class="p">{</span><span·class="s2">"x"</span><span·class="p">:</span>·<span·class="nb">range</span><span·class="p">(</span><span·class="mi">100</span><span·class="p">),</span>·<span·class="s2">"y"</span><span·class="p">:</span>·<span·class="nb">range</span><span·class="p">(</span><span·class="mi">100</span><span·class="p">)})</span> |
4450 | <span·class="gp">In·[45]:·</span><span·class="n">ds</span><span·class="p">[</span><span·class="s2">"distance"</span><span·class="p">]</span>·<span·class="o">=</span>·<span·class="n">np</span><span·class="o">.</span><span·class="n">sqrt</span><span·class="p">(</span><span·class="n">ds</span><span·class="o">.</span><span·class="n">x</span>·<span·class="o">**</span>·<span·class="mi">2</span>·<span·class="o">+</span>·<span·class="n">ds</span><span·class="o">.</span><span·class="n">y</span>·<span·class="o">**</span>·<span·class="mi">2</span><span·class="p">)</span> | 4450 | <span·class="gp">In·[45]:·</span><span·class="n">ds</span><span·class="p">[</span><span·class="s2">"distance"</span><span·class="p">]</span>·<span·class="o">=</span>·<span·class="n">np</span><span·class="o">.</span><span·class="n">sqrt</span><span·class="p">(</span><span·class="n">ds</span><span·class="o">.</span><span·class="n">x</span>·<span·class="o">**</span>·<span·class="mi">2</span>·<span·class="o">+</span>·<span·class="n">ds</span><span·class="o">.</span><span·class="n">y</span>·<span·class="o">**</span>·<span·class="mi">2</span><span·class="p">)</span> |
4451 | <span·class="gp">In·[46]:·</span><span·class="n">ds</span><span·class="o">.</span><span·class="n">distance</span><span·class="o">.</span><span·class="n">where</span><span·class="p">(</span><span·class="n">ds</span><span·class="o">.</span><span·class="n">distance</span>·<span·class="o"><</span>·<span·class="mi">100</span><span·class="p">)</span><span·class="o">.</span><span·class="n">plot</span><span·class="p">()</span> | 4451 | <span·class="gp">In·[46]:·</span><span·class="n">ds</span><span·class="o">.</span><span·class="n">distance</span><span·class="o">.</span><span·class="n">where</span><span·class="p">(</span><span·class="n">ds</span><span·class="o">.</span><span·class="n">distance</span>·<span·class="o"><</span>·<span·class="mi">100</span><span·class="p">)</span><span·class="o">.</span><span·class="n">plot</span><span·class="p">()</span> |
4452 | <span·class="gh">Out[46]:·</span><span·class="go"><matplotlib.collections.QuadMesh·at·0xffff | 4452 | <span·class="gh">Out[46]:·</span><span·class="go"><matplotlib.collections.QuadMesh·at·0xffff2a3553d0></span> |
4453 | </pre></div> | 4453 | </pre></div> |
4454 | </div> | 4454 | </div> |
4455 | <a·class="reference·internal·image-reference"·href="_images/where_example.png"><img·alt="_images/where_example.png"·src="_images/where_example.png"·style="width:·4in;·height:·4in;"·/></a> | 4455 | <a·class="reference·internal·image-reference"·href="_images/where_example.png"><img·alt="_images/where_example.png"·src="_images/where_example.png"·style="width:·4in;·height:·4in;"·/></a> |
4456 | </li> | 4456 | </li> |
4457 | <li><p>Added·new·methods·<code·class="docutils·literal·notranslate"><span·class="pre">xray.DataArray.diff</span></code>·and·<code·class="docutils·literal·notranslate"><span·class="pre">xray.Dataset.diff</span></code> | 4457 | <li><p>Added·new·methods·<code·class="docutils·literal·notranslate"><span·class="pre">xray.DataArray.diff</span></code>·and·<code·class="docutils·literal·notranslate"><span·class="pre">xray.Dataset.diff</span></code> |
4458 | for·finite·difference·calculations·along·a·given·axis.</p></li> | 4458 | for·finite·difference·calculations·along·a·given·axis.</p></li> |
4459 | <li><p>New·<code·class="docutils·literal·notranslate"><span·class="pre">xray.DataArray.to_masked_array</span></code>·convenience·method·for | 4459 | <li><p>New·<code·class="docutils·literal·notranslate"><span·class="pre">xray.DataArray.to_masked_array</span></code>·convenience·method·for |
Offset 2957, 15 lines modified | Offset 2957, 15 lines modified | ||
2957 | ····*·New·xray.Dataset.where·method·for·masking·xray·objects·according·to·some | 2957 | ····*·New·xray.Dataset.where·method·for·masking·xray·objects·according·to·some |
2958 | ······criteria.·This·works·particularly·well·with·multi-dimensional·data: | 2958 | ······criteria.·This·works·particularly·well·with·multi-dimensional·data: |
2959 | ······In·[44]:·ds·=·xray.Dataset(coords={"x":·range(100),·"y":·range(100)}) | 2959 | ······In·[44]:·ds·=·xray.Dataset(coords={"x":·range(100),·"y":·range(100)}) |
2960 | ······In·[45]:·ds["distance"]·=·np.sqrt(ds.x·**·2·+·ds.y·**·2) | 2960 | ······In·[45]:·ds["distance"]·=·np.sqrt(ds.x·**·2·+·ds.y·**·2) |
2961 | ······In·[46]:·ds.distance.where(ds.distance·<·100).plot() | 2961 | ······In·[46]:·ds.distance.where(ds.distance·<·100).plot() |
2962 | ······Out[46]:·<matplotlib.collections.QuadMesh·at·0xffff | 2962 | ······Out[46]:·<matplotlib.collections.QuadMesh·at·0xffff2a3553d0> |
2963 | ······[_images/where_example.png] | 2963 | ······[_images/where_example.png] |
2964 | ····*·Added·new·methods·xray.DataArray.diff·and·xray.Dataset.diff·for·finite | 2964 | ····*·Added·new·methods·xray.DataArray.diff·and·xray.Dataset.diff·for·finite |
2965 | ······difference·calculations·along·a·given·axis. | 2965 | ······difference·calculations·along·a·given·axis. |
2966 | ····*·New·xray.DataArray.to_masked_array·convenience·method·for·returning·a | 2966 | ····*·New·xray.DataArray.to_masked_array·convenience·method·for·returning·a |
2967 | ······numpy.ma.MaskedArray. | 2967 | ······numpy.ma.MaskedArray. |
2968 | ······In·[47]:·da·=·xray.DataArray(np.random.random_sample(size=(5,·4))) | 2968 | ······In·[47]:·da·=·xray.DataArray(np.random.random_sample(size=(5,·4))) |