[FEA] Implement find_valid_index and its permutations (first_ and last_)
Open
feature request
good first issue
Python
- Dominant language
- C++
- Stars
- 9.8k
- Forks
- 1.1k
- Avg merge
- 3d 6m
- Merged PRs (30d)
- 278
Description
**Is your feature request related to a problem? Please describe.**
As a user, I'd like to be able to call `last_valid_index` or `first_valid_index` to get the index of the first/last non-null value in a Series.
**Describe the solution you'd like**
I'd like to be able to do the following with cudf:
```
import pandas as pd
import numpy as np
ser1 = [1,2,3,4]
ser2 = [1,2,3,None]
pdf = pd.DataFrame({'a':ser1, 'b':ser2})
print(pdf.b.last_valid_index())
2
```
**Additional context**
The pandas implementation is [here](https://github.com/pandas-dev/pandas/blob/v0.24.2/pandas/core/generic.py#L10195). This will help with API compatibility.
Contributor guide
Assessment
This issue has not been assessed yet.