Cudf: [FEA] Add forward and backward fill options to DataFrame.fillna

Created on 5 Apr 2019  路  14Comments  路  Source: rapidsai/cudf

It would be nice to have forward fill and backward fill options within the DataFrame.fillna method to use in time series applications. The "method" argument is already implemented in the API currently.

import cudf
df = cudf.DataFrame({'x': [1, 2, None, 4]})
df.fillna(method='ffill') # returns df with None filled as 2
df.fillna(method='bfill') # returns df with None filled as 4

This issue is somewhat of a continuation of #1106 .

cuDF (Python) feature request libcudf

Most helpful comment

Hi guys, any improvement here? there's a real use that needs this: https://stackoverflow.com/questions/64197834/fill-forward-cupy-cudf/64217244

We have just started scoping this where we're hoping to be able to tackle this in 0.18.

All 14 comments

@harrism added the libcudf label because I'll imagine we want to implement this functionality / have an API for accomplishing this from libcudf as well.

@kkraus14 Perhaps this should be in 0.8 along with dropna #911 ?

I'm looking into this - PR incoming!

Bump!

Can someone please look into fillna methods like ffill, bfill for groupby objects?

Also, will this work for string columns, once implemented?

I'm "unassigning" myself from this as I never got around to it - apologies :-( Defer to @harrism and @kkraus14 to prioritize/assign.

We're generally only doing bug fixes / tech debt / documentation in 0.14 (and a few urgent performance things). New features are mostly reprioritized until 0.15.

@harrism any plan to include ffill() and bfill() methods in 0.16 nightlies? Thanks.

bump

Hi guys, any improvement here? there's a real use that needs this: https://stackoverflow.com/questions/64197834/fill-forward-cupy-cudf/64217244

Hi guys, any improvement here? there's a real use that needs this: https://stackoverflow.com/questions/64197834/fill-forward-cupy-cudf/64217244

We have just started scoping this where we're hoping to be able to tackle this in 0.18.

Thanks @kkraus14 !

For anyone who needs a quick implementation of fillna withmethod and limit support. Here is a Numba implementation.
fillna.zip

Was this page helpful?
0 / 5 - 0 ratings