fill_na_operator

Fill NaN values for one or more dataframes

class tasrif.processing_pipeline.pandas.fill_na_operator.FillNAOperator(**kwargs)

Examples

>>> import pandas as pd
>>> import numpy as np
>>>
>>> from tasrif.processing_pipeline.pandas import FillNAOperator
>>>
>>> df = pd.DataFrame({"name": ['Alfred', 'juli', 'Tom', 'Ali'],
...                   "height": [np.nan, 155, 159, 165],
...                   "born": [pd.NaT, pd.Timestamp("2010-04-25"), pd.NaT,
>>>
>>>
>>> operator = FillNAOperator(axis=0, value='laptop')
>>> df = operator.process(df)[0]
>>> df
name    height  born
0   Alfred  laptop  laptop
1   juli    155     2010-04-25 00:00:00
2   Tom     159     laptop
3   Ali     165     laptop
__init__(**kwargs)

Initializes the operator

Parameters

**kwargs – key word arguments passed to pandas DataFrame.dropna method