surveyweathertool.src.weather_x_survey.utils

Module Contents

Functions

read_survey_data(survey_csv_path)

Reads any survey data with geoinformation from a CSV file, renames some columns, sorts by date, removes NaN values, and resets the index.

filter_weather_data(file_path[, years])

Reads a weather data CSV file, cleans and formats the data, and optionally filters it by year.

surveyweathertool.src.weather_x_survey.utils.read_survey_data(survey_csv_path)

Reads any survey data with geoinformation from a CSV file, renames some columns, sorts by date, removes NaN values, and resets the index.

Parameters: survey_csv_path: str

The path to the CSV file containing the household geoinformation.

Returns: hh_df: DataFrame

The preprocessed household survey data.

surveyweathertool.src.weather_x_survey.utils.filter_weather_data(file_path, years=None)

Reads a weather data CSV file, cleans and formats the data, and optionally filters it by year.

Parameters: file_path: str

The path to the CSV file containing the weather data.

years: int, list, or tuple, optional

The year or range of years to filter the data by. If an int is passed, the data will be filtered for that specific year. If a list or tuple of two elements is passed, it will be interpreted as the start and end years of the range (inclusive). If no value is passed, no filtering will be performed.

Returns: DataFrame

The cleaned and optionally filtered weather data.