trajminer.utils.CSVTrajectoryLoader

class trajminer.utils.CSVTrajectoryLoader(file, sep=', ', tid_col='tid', label_col='label', lat='lat', lon='lon', drop_col=[], n_jobs=1)

A trajectory data loader from a CSV file.

filestr

The CSV file from which to read the data.

sepstr (default=’,’)

The CSV separator.

tid_colstr (default=’tid’)

The column in the CSV file corresponding to the trajectory IDs.

label_colstr (default=’label’)

The column in the CSV file corresponding to the trajectory labels. If None, labels are not loaded.

latstr (default=’lat’)

The column in the CSV file corresponding to the latitude of the trajectory points. If both the lat and lon columns are present in the file, they are included as a single new attribute in the loaded dataset.

lonstr (default=’lon’)

The column in the CSV file corresponding to the longitude of the trajectory points. If both the lat and lon columns are present in the file, they are included as a single new attribute in the loaded dataset.

drop_colarray-like (default=[])

List of columns to drop when reading the data from the file.

n_jobsint (default=1)

The number of parallel jobs.

>>> from trajminer.utils import CSVTrajectoryLoader
>>> loader = CSVTrajectoryLoader('my_data.csv')
>>> dataset = loader.load()
>>> dataset.get_attributes()
['poi', 'day', 'time']
__init__(file, sep=', ', tid_col='tid', label_col='label', lat='lat', lon='lon', drop_col=[], n_jobs=1)

Initialize self. See help(type(self)) for accurate signature.

load()

Loads trajectories according to the specific approach.

datatrajminer.TrajectoryData

A trajminer.TrajectoryData containing the loaded dataset.