watex.utils.read_data#
- watex.utils.read_data(f, sanitize=Ellipsis, reset_index=Ellipsis, verbose=Ellipsis, **read_kws)[source]#
Assert and read specific files and url allowed by the package
Readable files are systematically convert to a data frame.
- Parameters:
f (str, Path-like object) – File path or Pathlib object. Must contain a valid file name and should be a readable file or url
sanitize (bool, default=False,) –
- Push a minimum sanitization of the data such as:
replace a non-alphabetic column items with a pattern ‘_’
cast data values to numeric if applicable
drop full NaN columns and rows in the data
reset_index (bool, default=False,) –
Reset index if full NaN columns are dropped after sanitization.
New in version 0.2.5: Apply minimum data sanitization after reading data.
read_kws (dict,) – Additional keywords arguments passed to pandas readable file keywords.
- Returns:
f – A dataframe with head contents by default.
- Return type:
pandas.DataFrame