statadict 1.1.0

Creator: bradpython12

Last updated:

0 purchases

statadict 1.1.0 Image
statadict 1.1.0 Images

Languages

Categories

Add to Cart

Description:

statadict 1.1.0

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)

License

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Customer Reviews

There are no reviews.