Skip to main content

pandas-xyz

Geospatial calculation accessor for pandas DataFrames.

Example Usage

pandas-xyz provides the .xyz DataFrame accessor:

>>> import pandas as pd
>>> import pandas_xyz

>>> df = pd.DataFrame.from_dict({
...   'lat': [40.0, 40.1, 40.3],
...   'lon': [-105.0, -105.0, -105.0]
... })

>>> df['displacement'] = df.xyz.ds_from_xy()
>>> df['displacement']
0        0.000000
1    11119.492664
2    22238.985329
dtype: float64

>>> df.xyz.s_from_ds()
0        0.000000
1    11119.492664
2    33358.477993
dtype: float64

Dependencies and Installation

Pandas, NumPy, and SciPy are required.

The package is available on PyPi and can be installed with pip:

$ pip install pandas-xyz

License

License

This project is licensed under the MIT License. See LICENSE file for details.

Documentation

The official documentation is hosted at readthedocs: https://pandas-xyz.readthedocs.io/en/stable/

The Elevation Smoothing Algorithm

The algorithm I apply to filter elevation time series is based on a paper produced by the National Renewable Energy Laboratory. Their algorithm is meant to smooth the elevation time series of a moving vehicle for more reasonable estimates of road grades for energy consumption models. This actually isn't that different from my end goal of smoothing elevation series for more reasonable estimates of elevation gain and energy consumption by ambulating humans! The paper is included in the resources folder

Project Status

Complete

  • Implement an algorithm to smooth noisy elevation time series.
  • Implement a smoothing algorithm for elevation series as a function of distance (similar to how the completed time-smoother works.)

Current Activities

  • Implement an algorithm to smooth GPS position and speed data. Most GPS-enabled activity trackers filter their speed and distance timeseries to remove measurement noise. I want to try and figure out how they do it, then replicate their techniques, and compare the smoothed position data.
  • Develop and document a variety of elevation gain/loss algorithms.
  • Describe the algorithms in more detail. Maybe in a wiki?
  • Provide references to papers and other resources where I got inspiration for each algorithm.

Future Work

  • Benchmark algorithm performance (speed, accuracy, and consistency):
    • Generate dummy time series of (distance, elevation) data to check smoothing algorithm.
    • Generate series of GPS points to obtain elevation coordinates from various DEMs (using elevation-query package) to compare elevation datasets with and without smoothing.
  • Create gain/loss algorithms to emulate those employed by Strava / TrainingPeaks / Garmin.

Contact

Reach out to me at one of the following places!

Metadata

Release files for pandas-xyz 0.0.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pandas-xyz 0.0.5
File Size Uploaded Provenance Actions
pandas-xyz-0.0.5.tar.gz 14.8 kB Without provenance Details for pandas-xyz-0.0.5.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pandas-xyz 0.0.5
File Interpreter ABI Platform Actions
pandas_xyz-0.0.5-py3-none-any.whl Python 3 none any Details for pandas_xyz-0.0.5-py3-none-any.whl

Total release size: 31.2 kB

Release files / pandas-xyz-0.0.5.tar.gz

Download URL pandas-xyz-0.0.5.tar.gz
Size 14.8 kB
Tags Source
SHA-256 checksum
How to use checksums
934cbaab79e13f64182b57b211c45bb6c8e82865361730f354d0f6a3053f33b3
BLAKE2b-256 checksum
How to use checksums
9748c849337d0cc24de583376a719b8a4183c9da534a499493a069f2677597b4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.4.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.7.5

Release files / pandas_xyz-0.0.5-py3-none-any.whl

Download URL pandas_xyz-0.0.5-py3-none-any.whl
Size 16.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
38176da3b0e5c9b69b5aadfcadf66a23abeb3192a4b7067c7e4ccca88ef98781
BLAKE2b-256 checksum
How to use checksums
688032ef1393195f446e6a66abe1ceee5a1abbb7cad5855a8da46b90c664c2e2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.4.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.7.5

Security for pandas-xyz 0.0.5

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.0.5 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page