- ctdfjorder.CTD.CTD.save_to_csv(self, output_file: str, null_value: str | None) None#
Renames the columns of the CTD data table based on a predefined mapping and saves the data to the specified CSV file.
- Raises:
IOError – If there is an error in writing to the specified file path.
- Parameters:
output_file (str) – The output CSV file path.
null_value (str) – The value to represent null cells in the saved file.
Notes
This method will rename the columns of the CTD dataset based on a predefined mapping. After renaming, the dataset is saved to the specified CSV file. If a file with the same name already exists at the specified path, it will be overwritten.
The procedure is as follows:
Rename the columns of the CTD data table using a predefined mapping.
Save the modified data table to the specified CSV file path.
The predefined column mapping ensures that the column names in the output CSV file adhere to a specific naming convention or format required for further analysis or sharing.
Examples
ctd_data = CTD('example.csv') ctd_data.save_to_csv(output_file='path/to/output.csv') # This will rename the columns of the CTD dataset and save it to 'path/to/output.csv'. # Any existing file with the same name at that location will be overwritten.
See also
utils.save_to_csvUtility function used to save the data to a CSV file.