Skip to content

Commit

Permalink
Fixed doctest for last_valid_index (#1725)
Browse files Browse the repository at this point in the history
Quick fix for build failure. The PR #1705 have failed since It made conflicts with #1712 .

`Series` has no more default name `0`,  we should not include it to the result.

- previous behaviour
```python
>>> s = ks.Series([1, 2, 3, None, None], index=[100, 200, 300, 400, 500])
>>> s
100    1.0
200    2.0
300    3.0
400    NaN
500    NaN
name: 0, dtype: float64
```

- current behaviour
```python
>>> s = ks.Series([1, 2, 3, None, None], index=[100, 200, 300, 400, 500])
>>> s
100    1.0
200    2.0
300    3.0
400    NaN
500    NaN
dtype: float64
```
  • Loading branch information
itholic committed Aug 25, 2020
1 parent d274748 commit 80ba7c9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions databricks/koalas/generic.py
Expand Up @@ -1749,7 +1749,7 @@ def last_valid_index(self):
300 3.0
400 NaN
500 NaN
Name: 0, dtype: float64
dtype: float64
>>> s.last_valid_index() # doctest: +SKIP
300
Expand All @@ -1771,7 +1771,7 @@ def last_valid_index(self):
falcon speed NaN
weight NaN
length NaN
Name: 0, dtype: float64
dtype: float64
>>> s.last_valid_index() # doctest: +SKIP
('cow', 'weight')
Expand Down

0 comments on commit 80ba7c9

Please sign in to comment.