Skip to main content

A package for aggregating and merging US geographic data frames.

Project description

USAggregate

USAggregate is a Python package for aggregating and merging US geographic data frames.

Installation

You can install the package using pip:

pip install USAggregate

Below is an example of package usage.

import pandas as pd
from USAggregate import usaggregate

data_zip = pd.DataFrame({
    'zip': [98199, 98103, 98001, 98002, 91360, 91358, 93001, 93003],
    'value1': [1, 2, 3, 4, 5, 6, 7, 8],
    'chr1': ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H']
    })

data_city = pd.DataFrame({
        'city': ['Seattle', 'Auburn', 'Thousand Oaks', 'Ventura'],
        'state': ['WA', 'WA', 'CA', 'CA'],
        'value2': [1, 2, 3, 4],
        'chr2' : ['A', 'B', 'C', 'D']
    })

data_county = pd.DataFrame({
        'county': ['King County', 'Ventura County'],
        'state': ['Washington', 'California'],
        'value3': [5, 6],
        'chr3': ['G', 'H']
    })

    # Using the function
result1 = usaggregate([data_zip, data_city, data_county], level='state', agg_numeric='sum', agg_character='first')

# Example usage of usaggregate function
result = usaggregate([data_city, data_county], level='state')
print(result)

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

usaggregate-1.0.1.tar.gz (322.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

USAggregate-1.0.1-py3-none-any.whl (325.5 kB view details)

Uploaded Python 3

File details

Details for the file usaggregate-1.0.1.tar.gz.

File metadata

  • Download URL: usaggregate-1.0.1.tar.gz
  • Upload date:
  • Size: 322.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.4

File hashes

Hashes for usaggregate-1.0.1.tar.gz
Algorithm Hash digest
SHA256 efc1d498224bc0e27a02ff6c56b2e48feaa497a63ca835f89520c8a8c6d2c16f
MD5 bf1dc8285f43e29811fa95cade611793
BLAKE2b-256 64da72e35c990606de156c1b6bdc2000f5fa19c42d3e62fb3da8c35a652cf83f

See more details on using hashes here.

File details

Details for the file USAggregate-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: USAggregate-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 325.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.4

File hashes

Hashes for USAggregate-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1ef4548ced148145b342c32df796d4e64dbff5157a3879f8e902840b68c5e332
MD5 16f59f0f4c6115f35e3be9f2cbead1bd
BLAKE2b-256 fba99a702a0926e3b3487bf339741b8dc5d31fe520bbdb30e30af2cd72c359f7

See more details on using hashes here.

Supported by

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