Skip to content

Commit 1beff52

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 9b489f6 commit 1beff52

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

comment_sortby.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,9 @@ I tested @jsignell's approach locally - it's much cleaner and handles all null t
55
Happy to update the PR with this implementation and add a multidimensional test case, e.g.:
66

77
```python
8-
ds = Dataset({
9-
"var": (["x", "y"], [[1, 2], [3, 4], [5, 6]]),
10-
"key": ("x", [3.0, np.nan, 1.0])
11-
})
8+
ds = Dataset(
9+
{"var": (["x", "y"], [[1, 2], [3, 4], [5, 6]]), "key": ("x", [3.0, np.nan, 1.0])}
10+
)
1211
result = ds.sortby("key", ascending=False)
1312
# x order: [0, 2, 1] with NaN row at end
1413
```

0 commit comments

Comments
 (0)