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.2.tar.gz
(322.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.2-py3-none-any.whl
(325.5 kB
view details)
File details
Details for the file usaggregate-1.0.2.tar.gz.
File metadata
- Download URL: usaggregate-1.0.2.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6cfebf1a4379162c6d6d08c40b59366170345d6a62ae1e2a3f69e38082c3a26f
|
|
| MD5 |
6a16dad9859c3643ae7d2eab81ec306f
|
|
| BLAKE2b-256 |
456903b9709c026b0621b25703cf46f9e7eda39677e69210a7aea00ca0ceaa6e
|
File details
Details for the file USAggregate-1.0.2-py3-none-any.whl.
File metadata
- Download URL: USAggregate-1.0.2-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 |
400afa9e5413074ec37829484822c0d8817eecc694b9f848ad8c351e7f329dce
|
|
| MD5 |
dccb517ef2a0f08df5d9273036672d1d
|
|
| BLAKE2b-256 |
db12b798466965aa3d0cfb09b681cf2c966000c4bf949d73fd9b44c70741e742
|