pyamr.utils.io package
Submodules
pyamr.utils.io.read module
Author: Bernard Hernandez Filename: Date: Description:
Functions:
|
This method return files with extension. |
|
This method... |
|
This method reads a csv file. |
|
Load all excel files into a pandas dataframe. |
|
This method loads data from the specified format. |
|
This function... |
|
This method... |
|
Load all excel files into a pandas dataframe. |
|
This function rename codes (i.e. |
- pyamr.utils.io.read.files_with_extension(folder, ext)[source]
This method return files with extension.
- Parameters:
folder (path containing the files.)
ext (selected extensions.)
- Returns:
ext_files
- Return type:
files in folder with the extensions in ext.
- pyamr.utils.io.read.read_csv_file(path, rename_map={}, std_cols=None, keep_cols=None, date_cols=[], **kwargs)[source]
This method reads a csv file.
- Note: 1. It uses the pandas function pd.read_csv.
Note: keep_cols is used instead of default usecols from pandas because when reading different files we cannot ensure that all have the same column names before renaming.
- Parameters:
rename_map
std_cols
keep_cols
date_cols
- pyamr.utils.io.read.read_csv_folder(path, **kwargs)[source]
Load all excel files into a pandas dataframe.
- Parameters:
folder
rename_map
std_cols
- pyamr.utils.io.read.read_data(ftype, **kwargs)[source]
This method loads data from the specified format.
- Parameters:
ftype (type of files to be load. Currently supported (xls, xlsx, csv, mysql).)
rename_map (dict-like, with current name and desired name.)
std_cols (list of columns that want to be kept.)
url (Only for ‘mysql’ - url to connect to the mysql sever.)
query (Only for ‘mysql’ - query to be executed against the server.)
- Return type:
dataframe - <DataFrame> from pandas with content.
- pyamr.utils.io.read.read_excel_file(path, rename_map={}, std_cols=None, **kwargs)[source]
This method…