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('./filename.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]
Add documentation:
pdoc --html --output-dir docs metatables
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.12.tar.gz
(7.9 kB
view hashes)
Built Distribution
Close
Hashes for metatables-0.0.12-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 51a540d22179f7b3f130d769d4284a4023ed7b09bcf037270c3c4287bdb26f6c |
|
MD5 | 8e110c66e80ab2827b5a61a650100905 |
|
BLAKE2b-256 | 799e2118bdf5fee22344163f9c09a1eea394a6b29c64ab314509514629bd6ad3 |