|
141 | 141 | {
|
142 | 142 | "data": {
|
143 | 143 | "text/plain": [
|
144 |
| - "<__main__.KDTreeIndex at 0x7f4606b8b8b0>" |
| 144 | + "<__main__.KDTreeIndex at 0x7f020877eee0>" |
145 | 145 | ]
|
146 | 146 | },
|
147 | 147 | "execution_count": 5,
|
|
216 | 216 | "data": {
|
217 | 217 | "text/plain": [
|
218 | 218 | "Indexes:\n",
|
219 |
| - "lat: <__main__.KDTreeIndex object at 0x7f4606b8b8b0>\n", |
220 |
| - "lon: <__main__.KDTreeIndex object at 0x7f4606b8b8b0>\n", |
221 |
| - "x: <xarray.core.indexes.PandasIndex object at 0x7f4606b8aea0>\n", |
222 |
| - "y: <xarray.core.indexes.PandasIndex object at 0x7f45fd3ddc20>" |
| 219 | + "lat: <__main__.KDTreeIndex object at 0x7f020877eee0>\n", |
| 220 | + "lon: <__main__.KDTreeIndex object at 0x7f020877eee0>\n", |
| 221 | + "x: <xarray.core.indexes.PandasIndex object at 0x7f01bf793400>\n", |
| 222 | + "y: <xarray.core.indexes.PandasIndex object at 0x7f01b5f0d180>" |
223 | 223 | ]
|
224 | 224 | },
|
225 | 225 | "execution_count": 7,
|
|
318 | 318 | "data": {
|
319 | 319 | "text/plain": [
|
320 | 320 | "Indexes:\n",
|
321 |
| - "x: <xarray.core.indexes.PandasIndex object at 0x7f4606b25590>\n", |
322 |
| - "y: <xarray.core.indexes.PandasIndex object at 0x7f4606b25220>" |
| 321 | + "x: <xarray.core.indexes.PandasIndex object at 0x7f01bf793720>\n", |
| 322 | + "y: <xarray.core.indexes.PandasIndex object at 0x7f01bf793540>" |
323 | 323 | ]
|
324 | 324 | },
|
325 | 325 | "execution_count": 10,
|
|
348 | 348 | "outputs": [
|
349 | 349 | {
|
350 | 350 | "data": {
|
351 |
| - "text/html": [ |
352 |
| - "<pre><xarray.DataArray (points: 3)>\n", |
353 |
| - "0.1097 -0.397 -0.7046\n", |
354 |
| - "Coordinates:\n", |
355 |
| - " lat (points) float64 0.7 10.2 17.6\n", |
356 |
| - " lon (points) float64 8.9 3.1 9.1\n", |
357 |
| - " x (points) int64 89 31 91\n", |
358 |
| - " y (points) int64 907 1002 1076\n", |
359 |
| - " distance (points) float64 0.04993 0.02385 0.06931\n", |
360 |
| - "Dimensions without coordinates: points</pre>" |
361 |
| - ], |
362 | 351 | "text/plain": [
|
363 |
| - "<xarray.DataArray (points: 3)>\n", |
364 |
| - "0.1097 -0.397 -0.7046\n", |
365 |
| - "Coordinates:\n", |
366 |
| - " lat (points) float64 0.7 10.2 17.6\n", |
367 |
| - " lon (points) float64 8.9 3.1 9.1\n", |
368 |
| - " x (points) int64 89 31 91\n", |
369 |
| - " y (points) int64 907 1002 1076\n", |
370 |
| - " distance (points) float64 0.04993 0.02385 0.06931\n", |
371 |
| - "Dimensions without coordinates: points" |
| 352 | + "Indexes:\n", |
| 353 | + "x: <xarray.core.indexes.PandasIndex object at 0x7f020878bc20>\n", |
| 354 | + "y: <xarray.core.indexes.PandasIndex object at 0x7f01bf793c70>" |
372 | 355 | ]
|
373 | 356 | },
|
374 | 357 | "execution_count": 11,
|
|
377 | 360 | }
|
378 | 361 | ],
|
379 | 362 | "source": [
|
380 |
| - "rolled = new_arr.roll(x=5, y=10)\n", |
381 |
| - "rolled.sel(indexers) # for easier comparison" |
| 363 | + "rolled = new_arr.roll(x=5, y=10, roll_coords=True)\n", |
| 364 | + "rolled.xindexes" |
382 | 365 | ]
|
383 | 366 | },
|
384 | 367 | {
|
|
399 | 382 | "data": {
|
400 | 383 | "text/plain": [
|
401 | 384 | "Indexes:\n",
|
402 |
| - "z: <xarray.core.indexes.PandasMultiIndex object at 0x7f45fd3e39e0>\n", |
403 |
| - "x: <xarray.core.indexes.PandasMultiIndex object at 0x7f45fd3e39e0>\n", |
404 |
| - "y: <xarray.core.indexes.PandasMultiIndex object at 0x7f45fd3e39e0>" |
| 385 | + "z: <xarray.core.indexes.PandasMultiIndex object at 0x7f01b6048c80>\n", |
| 386 | + "x: <xarray.core.indexes.PandasMultiIndex object at 0x7f01b6048c80>\n", |
| 387 | + "y: <xarray.core.indexes.PandasMultiIndex object at 0x7f01b6048c80>" |
405 | 388 | ]
|
406 | 389 | },
|
407 | 390 | "execution_count": 12,
|
|
0 commit comments