rapidsai/cudf

[FEA] Implement find_valid_index and its permutations (first_ and last_)

Open

#1,480 创建于 2019年4月22日

在 GitHub 查看
 (4 评论) (0 反应) (0 负责人)C++ (735 fork)batch import
Pythonfeature requestgood first issue

仓库指标

Star
 (6,000 star)
PR 合并指标
 (平均合并 17天 21小时) (30 天内合并 230 个 PR)

描述

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. This will help with API compatibility.

贡献者指南