Skip to main content

Python mobility library

Project description

pymobility

Work done by South Asia Poverty Team, The World Bank

pymobility is the Python package built on top of PySpark API, which faciliates big data processing. This package has several sub-packages and modules for quantifying mobility and migration from raw GPS data. The package takes delta formatted geo-tagged raw dataset and generates various datasets like Origin Destination matrix and net migration figures, and various statistics like average records in a time-period, average devices registered in a time period, etc.

pymobility has three sub-packages: odm, stm, and eda. odm is used for generating origin-destination figures. stm helps to quantify short term migration depending on whatever definition we use for short term migrants. The stm sub-package is made modular, and there are a number of parameters which can be set according to the definition of short term migrant used. Another sub-package, eda, helps to do exploratory data analysis. We can get statistics like average devices in some time-period, or average records in some time-period, etc. More documentation about the individual sub-packages is done on the sub-package README file itself.

Dependencies

As the package is built on top of PySpark API, Python API for Spark (or PySpark API) should be installed. The code is well tested on Python 3.6, so users are encouraged to have Python 3.6+ version.

Other Python packages used herein are Pandas.

Installation

Both pyspark and pandas can be installed using pip. The commands for them are given below:

pip install pandas
pip install pyspark

More details about pyspark can be found here.

Usage

This package can be used for quantifying mobility and migration from geo-taggged raw delta files. It facilitates following features.

  1. Origin Destination Matrix (OD matrix): Details about use of this library for quantifying origin-destination movement can be found in the README.md file inside the odm sub-package itself.

  2. Short Term Migration: This type of migration is quantified using stm sub-package, which facilitates flexibility in short term migrants' definition with the help of different parameters like away time period required, definition of home, etc.

  3. Exploratory Data Analysis: The exploratory data analysis can be done using the eda sub-package. Under eda commuter aggregates and mobility summary can be quantified. Details about its use can be found in the README.md.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pymobility-0.0.8.tar.gz (12.0 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page