morpheus.io.deserializers
Functions
|
Fixes parsing issues when reading from a file. |
|
Reads a file into a dataframe and performs any of the necessary cleanup. |
- cudf_json_onread_cleanup(x)[source]
Fixes parsing issues when reading from a file. When loading a JSON file, cuDF converts \n
to
\\n
for some reason.
- read_file_to_df(file_name, file_type=<FileTypes.Auto: 0>, parser_kwargs=None, filter_nulls=True, df_type='pandas')[source]
Reads a file into a dataframe and performs any of the necessary cleanup.
- Parameters
- file_namestr
- file_type
<a href="morpheus.common.html#morpheus.common.FileTypes">morpheus.common.FileTypes</a>
- parser_kwargsdict, optional
- filter_nullsbool, optional
- df_typetyping.Literal[, optional
File to read.
Type of file. Leave as Auto to determine from the extension.
Any argument to pass onto the parse, by default {}. Ignored when C++ execution is enabled and
df_type="cudf"
Whether to filter null rows after loading, by default True.
What type of parser to use. Options are ‘cudf’ and ‘pandas’, by default “pandas”.
- Returns
- typing.Union[cudf.DataFrame, pandas.DataFrame]
A parsed DataFrame.