arkouda icon indicating copy to clipboard operation
arkouda copied to clipboard

Series.fillna for dict

Open ajpotts opened this issue 11 months ago • 0 comments

The following example:

data = ak.Series([1, np.nan, 3, np.nan, 5])
fill_values = {1: 10, 3: 20}  # Dictionary with keys as index positions and values as fill values
filled_series = data.fillna(fill_values)

should output : Filled Series: 0 1.0 1 10.0 2 3.0 3 20.0 4 5.0

This depends on Series.map working when NaN values are in the index.

ajpotts avatar Mar 15 '24 17:03 ajpotts