bulum.io.res_csv_io module

IO functions for reading and writing .res.csv files.

read_res_csv(filename, custom_na_values=None, df=None, colprefix=None, allow_nonnumeric=False, use_field_name=False, **kwargs) TimeseriesDataframe

Reads a res csv data file into a DataFrame, and sets the index to the Date.

Parameters:
  • filename

  • custom_na_values (list of str) –

    : A list of values to override the automatically-determined missing values. If None, the missing values will include any defined in the .res.csv file as well as:

    ['', ' ', 'null', 'NULL', 'NAN', 'NaN', 'nan', 'NA', 'na', 'N/A' 'n/a', '#N/A', '#NA', '-NaN', '-nan'].
    

write_res_csv(df: DataFrame, filepath='out.res.csv', file_version=3, missing_data_value='', project_name='', source_version='5.30.0.12728', datetime_format='%d/%m/%y') None

Writes a dataframe to a res csv.

Parameters:
  • df (Dataframe) – Dataframe to write to res csv.

  • filepath – Path to output file including extension.

  • missing_data_value (str) – Identifier for missing data values. Defaults to empty string.