Skip to content

Commit 6756c70

Browse files
author
MAGIN
committed
try using the ipython format
1 parent 68b2622 commit 6756c70

File tree

1 file changed

+6
-9
lines changed
  • src/posts/introducing-pint-xarray

1 file changed

+6
-9
lines changed

src/posts/introducing-pint-xarray/index.md

+6-9
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,12 @@ summary: "Xarray now supports unit-aware operations by wrapping pint arrays"
99

1010
_TLDR: Xarray now supports unit-aware operations by wrapping [pint arrays](https://pint.readthedocs.io/en/stable/), so your code can automatically track the physical units that your data represents:_
1111

12-
```python
13-
distance = xr.DataArray(10).pint.quantify("metres")
14-
time = xr.DataArray(4).pint.quantify("seconds")
15-
16-
distance / time
17-
```
18-
19-
```
20-
Out:
12+
```ipython
13+
In [2]: distance = xr.DataArray(10).pint.quantify("metres")
14+
...: time = xr.DataArray(4).pint.quantify("seconds")
15+
...:
16+
...: distance / time
17+
Out[2]:
2118
<xarray.DataArray ()>
2219
<Quantity(2.5, 'meter / second')>
2320
```

0 commit comments

Comments
 (0)