Skip to main content

A library to read and write AGS4 files using Pandas DataFrames

Project description

python-ags4

A library to read and write AGS4 files using Pandas DataFrames

Installation

pip install python-ags4

Introduction

python-ags4 is a library of functions that lets a user import AGS4 files to a collection of Pandas DataFrames. The data can be analyzed, manipulated, and updated using Pandas and then exported back to an AGS4 file.

Examples

Import module:

from python_ags4 import AGS4

Import data from an AG4 file:

tables, headings = AGS4.AGS4_to_dataframe('/home/asitha/Projects/python-AGS4/tests/test_data.ags')
  • tables is a dictionary of Pandas DataFrames. Each DataFrame contains the data from a GROUP in the AGS4 file.
  • headings is a dictionary of lists. Each list has the header names of the corresponding GROUP

All data are imported as text so they cannot be analyzed or plotted immediately. You can use the following code to convert all the numerical data in a DataFrame from text to numeric.

LOCA = AGS4.convert_to_numeric(tables['LOCA'])

The AGS4.convert_to_numeric() function automatically converts all columns in the input DataFrame with the a numeric TYPE to a float.

Export data back to an AGS4 file:

AGS4.dataframe_to_AGS4(tables, headings, '/home/asitha/Documents/output.ags')

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

python-AGS4-0.1.6.tar.gz (16.5 kB view details)

Uploaded Source

Built Distribution

python_AGS4-0.1.6-py3-none-any.whl (16.8 kB view details)

Uploaded Python 3

File details

Details for the file python-AGS4-0.1.6.tar.gz.

File metadata

  • Download URL: python-AGS4-0.1.6.tar.gz
  • Upload date:
  • Size: 16.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.9 CPython/3.8.3 Linux/5.4.0-53-generic

File hashes

Hashes for python-AGS4-0.1.6.tar.gz
Algorithm Hash digest
SHA256 5c74976a3c247ea27f22001bc44910a8f7e54c604e4f3d6c33a3a78d1c9b8a8a
MD5 dc718517aa3e9149ae60b5d0b9f7a9ca
BLAKE2b-256 d65b78cafe006f351b545430a15423f337e3f0accdd6c3d6da22dea0db52c20b

See more details on using hashes here.

File details

Details for the file python_AGS4-0.1.6-py3-none-any.whl.

File metadata

  • Download URL: python_AGS4-0.1.6-py3-none-any.whl
  • Upload date:
  • Size: 16.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.9 CPython/3.8.3 Linux/5.4.0-53-generic

File hashes

Hashes for python_AGS4-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 c5c7b36693dbb8d2a3fa089b43cbeef460655f553f7a0a4c090e84bdaf07b10f
MD5 dd041c4958ac1b7a994cf8b6ca558569
BLAKE2b-256 1ff9c8ea3eeee16d25565325fbf2480237fb239576df5180e5c6deb4195da9f3

See more details on using hashes here.

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