cudf.DataFrame.fillna#
- DataFrame.fillna( ) Self | None[source]#
Fill null values with
value.- Parameters:
- valuescalar, Series-like or dict
Value to use to fill nulls. If Series-like, null values are filled with values in corresponding indices. A dict can be used to provide different values to fill nulls in different columns.
- Returns:
- resultDataFrame, Series, or Index
Copy with nulls filled.
Examples
>>> import cudf >>> df = cudf.DataFrame({'a': [1, 2, None], 'b': [3, None, 5]}) >>> df a b 0 1 3 1 2 <NA> 2 <NA> 5 >>> df.fillna(4) a b 0 1 3 1 2 4 2 4 5 >>> df.fillna({'a': 3, 'b': 4}) a b 0 1 3 1 2 4 2 3 5
fillnacan also supports inplace operation:>>> df.fillna({'a': 3, 'b': 4}, inplace=True) >>> df a b 0 1 3 1 2 4 2 3 5