Skip to main content

NanRemover

Converter
DashAI.back.converters.simple_converters.NanRemover

Remove rows that contain NaN (or null-like) values in the scoped columns.

Only the columns selected in scope are scanned for nulls; rows with nulls in those columns are dropped from the dataset. String representations of null such as "None", "nan", "N/A" are also treated as missing.

Methods​

fit(self, x: 'DashAIDataset', y: 'DashAIDataset' = None) -> 'NanRemover'

Defined on NanRemover

Record the scoped column names and their types for use in transform.

Parameters

x : DashAIDataset
The scoped dataset whose column names and types are stored.
y : DashAIDataset, optional
Ignored. Defaults to None.

Returns

NanRemover
The fitted converter instance (self).

get_output_type(self, column_name: str = None) -> DashAI.back.types.dashai_data_type.DashAIDataType

Defined on NanRemover

Return the preserved type for a column, or a Text placeholder.

Parameters

column_name : str, optional
Name of the column to look up. Defaults to None.

Returns

DashAIDataType
The original type stored during fit if available; otherwise a Text type backed by pyarrow.string().

rows_to_keep(self, x: 'DashAIDataset') -> List[int]

Defined on NanRemover

Positions of the rows with no missing value in the fitted columns.

Parameters

x : DashAIDataset
The dataset to inspect; it must contain every fitted column.

Returns

list of int
0-based positions of the complete rows, in order.

transform(self, x: 'DashAIDataset', y: 'DashAIDataset' = None) -> 'DashAIDataset'

Defined on NanRemover

Drop all rows containing null or null-like values in the scoped columns.

Parameters

x : DashAIDataset
The dataset to clean.
y : DashAIDataset, optional
Ignored. Defaults to None.

Returns

DashAIDataset
A new dataset with null-containing rows removed.

get_credential(self, name: str)

Defined on ConfigObject

Resolve a registered credential component by name.

Parameters

name : str
Credential component class name (e.g. "HuggingFaceCredential").

Returns

BaseCredential
An instance of the requested credential component.

get_metadata(cls) -> 'Dict[str, Any]'

Defined on BaseConverter

Get metadata for the converter, used by the DashAI frontend.

Parameters

cls : type
The converter class (injected automatically by Python for classmethods).

Returns

Dict[str, Any]
Dictionary containing display name, short description, image preview path, category, icon, color, and whether the converter is supervised.

get_schema(cls) -> dict

Defined on ConfigObject

Generates the component related Json Schema.

Returns

dict
Dictionary representing the Json Schema of the component.

infer_output_columns(self, inputs: 'List[StateItem]') -> 'StructureDelta'

Defined on BaseConverter

Estimate what this converter does to its scope, without any data.

Parameters

inputs : list of ColumnItem | BlockItem
The dataset state items in this converter's scope.

Returns

StructureDelta
The scope items that survive (maybe retyped) and the new items.

validate_and_transform(self, raw_data: dict) -> dict

Defined on ConfigObject

It takes the data given by the user to initialize the model and returns it with all the objects that the model needs to work.

Parameters

raw_data : dict
A dictionary with the data provided by the user to initialize the model.

Returns

dict
A validated dictionary with the necessary objects.