Fill NA/NaN values using the specified method.
If a scalar value is passed it is used to fill all missing values. Alternatively, an array-like âvalueâ can be given. Itâs expected that the array-like have the same length as âselfâ.
Method to use for filling holes in reindexed Series:
pad / ffill: propagate last valid observation forward to next valid.
backfill / bfill: use NEXT valid observation to fill gap.
Deprecated since version 2.1.0.
If method is specified, this is the maximum number of consecutive NaN values to forward/backward fill. In other words, if there is a gap with more than this number of consecutive NaNs, it will only be partially filled. If method is not specified, this is the maximum number of entries along the entire axis where NaNs will be filled.
Deprecated since version 2.1.0.
Whether to make a copy of the data before filling. If False, then the original should be modified and no new memory should be allocated. For ExtensionArray subclasses that cannot do this, it is at the authorâs discretion whether to ignore âcopy=Falseâ or to raise. The base class implementation ignores the keyword in pad/backfill cases.
With NA/NaN filled.
Examples
>>> arr = pd.array([np.nan, np.nan, 2, 3, np.nan, np.nan]) >>> arr.fillna(0) <IntegerArray> [0, 0, 2, 3, 0, 0] Length: 6, dtype: Int64
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4