Skip to main content

clean

Clean up NaNs from the dataset

Source Code: [link]

openbb.forecast.clean(dataset: pd.DataFrame, fill: Optional[str] = None, drop: Optional[str] = None, limit: Optional[int] = None)

Parameters

NameTypeDescriptionDefaultOptional
datasetpd.DataFrameThe dataset you wish to cleanNoneFalse
fillOptional[str]The method of filling NaNsNoneTrue
dropOptional[str]The method of dropping NaNsNoneTrue
limitOptional[int]The maximum limit you wish to apply that can be forward or backward filledNoneTrue

Returns

TypeDescription
Tuple[pd.DataFrame, np.bool_]The cleaned dataset and a boolean indicating if there are any NaNs left