Commit 601c262
authored
Shortened display of NumPy arrays in DataArray.__repr__ (#1207)
* Shortened display of NumPy arrays in DataArray.__repr__
This shortens the array portion of DataArray repr to reasonable lengths for high
dimensional arrays:
Array | Old length | New length
------------------------------+------------+-----------
np.random.randn(500) | 167 | 1
np.random.randn(20, 20) | 150 | 7
np.random.randn(5, 10, 15) | 254 | 24
np.random.randn(5, 10, 15, 3) | 248 | 19
air_temperature['air'] | 41 | 24
rasm['Tair'] | 37 | 24
where the last two entries refer to the corresponding datasets loaded from
`xarray.tutorial.load_dataset`.
Importantly, this change does not preclude future improvements, such as those
suggested in GH1044.
* fix spelling
* a little more explanation in what's new1 parent fec5bac commit 601c262
File tree
3 files changed
+57
-1
lines changed- doc
- xarray
- core
- test
3 files changed
+57
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
84 | 84 | | |
85 | 85 | | |
86 | 86 | | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
87 | 91 | | |
88 | 92 | | |
89 | 93 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
| |||
336 | 337 | | |
337 | 338 | | |
338 | 339 | | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
339 | 368 | | |
340 | 369 | | |
341 | 370 | | |
| |||
349 | 378 | | |
350 | 379 | | |
351 | 380 | | |
352 | | - | |
| 381 | + | |
353 | 382 | | |
354 | 383 | | |
355 | 384 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
130 | 130 | | |
131 | 131 | | |
132 | 132 | | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
0 commit comments