Utility for parsing Stata dictionary files for usage with Pandas.
Project description
statadict
Small package that allows reading Stata dictionary files (usually .dct extension).
Extracted information can be used with Pandas when calling read_fwf() function.
Setup
To install package locally:
python3 -m pip install statadict --user
Or directly from repository:
make all
python3 -m pip install . --user
Usage
Having Stata dictionary file and related fixed width field csv file without headers, you can now use Pandas to read data:
import pandas as pd
from statadict import parse_stata_dict
stata_dict = parse_stata_dict(file="dictionary-file.dct")
data = pd.read_fwf("related-fwf-file.dat", names=stata_dict.names, colspecs=stata_dict.colspecs)
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
statadict-1.1.0.tar.gz
(11.5 kB
view hashes)
Built Distribution
Close
Hashes for statadict-1.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 67d739f46cc9495c200126d59259243d11bdde35eba9b57b69ac85eeb8a7578f |
|
MD5 | 5ba964aa8f22855b587ebcbd82b50127 |
|
BLAKE2b-256 | 5103eb50a0bafb5afabcae3efb57e0fdd477ff1016dddc6953727e46b34d6637 |