Data wrangling on files read with pyreadstat
Project description
metatables
This is a repository that enables easy data wrangling on files read with the pyreadstat package.
Installation
Run the following to install:
pip install metatables
Usage
from metatables import MetaTable
# Add files from pyreadstat to MetaTable
x = MetaTable(df, meta)
# change val_lab of variables 'F5_01' and 'F5_02'
x.val_lab(['F5_01', 'F5_02'], {1: 'Fish', 2: 'Chips'})
# change var_lab of the same variables to 'New Label'
x.var_lab(['F5_01', 'F5_02'], 'New Label')
# select columns that should be kept in MetaTable
x.select_columns(['F5_01', 'F5_02'])
# show info about variable 'F5_01'
x.show('F5_01')
# write to .sav file
x.write_sav('./data/fertig_test.sav')
Developing
To install the package, along with the tools you need to develop and run tests, run the following in your virtualenv:
pip install -e .[dev]
Create the package files:
python setup.py sdist bdist_wheel
Upload to pypi.org:
twine upload dist/*
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
metatables-0.0.9.tar.gz
(7.9 kB
view hashes)
Built Distribution
Close
Hashes for metatables-0.0.9-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e2acc664f818a6befe4fcd5061f34922f3f39e8d76cd2e31e7bde89a9d0d4e77 |
|
MD5 | 508fe150a2d31619b192b23d90ebeed7 |
|
BLAKE2b-256 | 220dd0eddeb2892129cb4624fc8478bf08a7d586df5ee16e2725d30cf0e4a735 |