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
Release history Release notifications | RSS feed
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.3.tar.gz
(5.0 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
USAggregate-1.0.3-py3-none-any.whl
(325.5 kB
view details)
File details
Details for the file usaggregate-1.0.3.tar.gz.
File metadata
- Download URL: usaggregate-1.0.3.tar.gz
- Upload date:
- Size: 5.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b5cd4c9f8179d9e9c0035e4654cc8695eac22df574e7751b85762345a7708304
|
|
| MD5 |
621c147347fe28f73f88971946cd275e
|
|
| BLAKE2b-256 |
2bcbb4036c76ec8d36034bff8f3f9ce544f730c158a010f9245881f7009a18cd
|
File details
Details for the file USAggregate-1.0.3-py3-none-any.whl.
File metadata
- Download URL: USAggregate-1.0.3-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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6d1c3dabf42e11067b935230832eb701601a7724c8890eaaf4fa74bcd431e894
|
|
| MD5 |
e3a9c761bd4bc5cac3556f9ec992b626
|
|
| BLAKE2b-256 |
a3f1d972af29b403cdf3b9f74266fd9d2b86dc587eced03a09a34374bd6463e7
|