load_data¶
This module contains functions for loading and processing data from JSON and Excel files.
- prepshot.load_data.compute_cost_factors(data_store)[source]¶
Calculate cost factors for various transmission investment and operational costs.
- Parameters
data_store (dict) -- Dictionary containing loaded parameters.
- Return type
None
- prepshot.load_data.extract_config_data(config_data)[source]¶
Extract necessary data from configuration settings.
- Parameters
config_data (dict) -- Configuration data for the model.
- Returns
Dictionary containing necessary configuration data.
- Return type
dict
- prepshot.load_data.extract_sets(data_store)[source]¶
Extract simple sets from loaded parameters.
- Parameters
data_store (dict) -- Dictionary containing loaded parameters.
- Return type
None
- prepshot.load_data.load_excel_data(input_folder, params_info, data_store)[source]¶
Load data from Excel files based on the provided parameters.
- Parameters
input_folder (str) -- Path to the input folder.
params_info (dict) -- Dictionary containing parameter names and their corresponding file information.
data_store (dict) -- Dictionary to store loaded data.
- Return type
None
- prepshot.load_data.load_json(file_path)[source]¶
Load data from a JSON file.
- Parameters
file_path (str) -- Path to the JSON file.
- Returns
Dictionary containing data from the JSON file.
- Return type
dict
- prepshot.load_data.process_data(params_info, input_folder)[source]¶
Load and process data from input folder based on parameters settings.
- Parameters
params_info (dict) -- Dictionary containing parameters information.
input_folder (str) -- Path to the input folder.
- Returns
Dictionary containing processed parameters.
- Return type
dict
- prepshot.load_data.read_excel(filename, index_cols, header_rows, unstack_levels=None, first_col_only=False, dropna=True)[source]¶
Read data from an Excel file into a pandas DataFrame.
- Parameters
filename (str) -- The name of the input Excel file.
index_cols (list) -- List of column names to be used as index.
header_rows (list) -- List of rows to be used as header.
unstack_levels (list, optional) -- List of levels to be unstacked, by default None
first_col_only (bool, optional) -- Whether to keep only the first column, by default False
dropna (bool, optional) -- Whether to drop rows with NaN values, by default True
- Returns
A DataFrame containing the data from the Excel file.
- Return type
pandas.DataFrame