Learn practical skills, build real-world projects, and advance your career
Created 2 years ago
The Data Module
"Load ready-to-use mobility datasets with ONE line of code!"
The new version of scikit-mobility (1.3.0) includes a piece of big news! The Data Module.
The Data Module allows you to retrieve mobility datasets via an easy-to-use interface.
The data module API consists of two main functions: list_datasets
and load_dataset
.
list_datasets
shows the datasets already available in the repository;load_dataset
retrieves the requested dataset and directly outputs it into a skmob-friendly data structure.
The scikit-mobility data types and format to describe mobility data are the following:
- trajectory
TrajDataFrame
- flow
FlowDataFrame
- shape
GeoDataFrame
- auxiliar
DataFrame
import skmob
from skmob.data.load import load_dataset, list_datasets
import pandas as pd
import warnings
warnings.filterwarnings("ignore")
print(skmob.__version__)
1.3.0
1. list_datasets()
list_datasets
shows the names and information of the datasets already available in the scikit-mobility repository;
# list all the datasets' names without details
print(list_datasets())
['flow_foursquare_nyc', 'foursquare_nyc', 'nyc_boundaries', 'parking_san_francisco', 'taxi_san_francisco']