aito.utils.data_frame_handler.DataFrameHandler.convert_file¶
-
DataFrameHandler.
convert_file
(read_input: Union[str, pathlib.Path, IO], write_output: Union[str, pathlib.Path, IO], in_format: str, out_format: str, read_options: Dict = None, convert_options: Dict = None, apply_functions: List[Callable[[…], pandas.DataFrame]] = None, use_table_schema: Union[aito.schema.AitoTableSchema, Dict] = None) → pandas.DataFrame¶ Converting input file to expected format, generate or use Aito table schema if specified
- Parameters
read_input (any valid string path, pathlike object, or file-like object (objects with a read() method)) – read input
write_output (any valid string path, pathlike object, or file-like object (objects with a read() method)) – write output
in_format (str) – input format
out_format (str) – output format
read_options (Dict, optional) – dictionary contains arguments for pandas read function, defaults to None
convert_options (Dict, optional) – dictionary contains arguments for pandas write function, defaults to None
apply_functions (List[Callable[.., pd.DataFrame]], optional) – list of partial functions that will be applied to the loaded pd.DataFrame, defaults to None
use_table_schema (an AitoTableSchema object or a Dict, optional) – use an aito schema to dictates data types and convert the data, defaults to None
- Returns
converted DataFrame
- Return type
pd.DataFrame