microquantum.analytics.csv_loader¶
CSV and DataFrame ingestion for analytics modules.
Provides utilities to load data from CSV files or numpy arrays.
Module Contents¶
- microquantum.analytics.csv_loader.load_csv(filepath, delimiter=',', has_header=True)[source]¶
Load data from a CSV file.
- microquantum.analytics.csv_loader.load_csv_column(filepath, column, delimiter=',')[source]¶
Load a single column from a CSV file.
- Parameters:
- Returns:
1D numpy array of the column values.
- Return type:
- microquantum.analytics.csv_loader.load_distance_matrix(filepath, delimiter=',')[source]¶
Load a distance matrix from a CSV file.
The CSV should have cities as rows and columns, with distances. First row and column can be city names (optional).
- Parameters:
- Returns:
2D numpy array of distances.
- Return type:
- microquantum.analytics.csv_loader.arrays_to_csv(filepath, headers, data, delimiter=',')[source]¶
Save numpy arrays to a CSV file.
- Parameters:
filepath (str) – Path to save the CSV file.
data (numpy.ndarray) – 2D numpy array of data.
delimiter (str) – Column delimiter.
- Return type:
None