<jupyter_start><jupyter_text>Table of Contents<jupyter_code>%matplotlib inline
import pandas as pd
import numpy as np
VARIABLE_NAMES_HGEN = {
    'hid': 'ID_HH',
    'syear': 'YEAR',
    'hghinc': 'HH_NET_INCOME_MONTHLY',
}

RETAINED_COLUMNS_HGEN = list(VARIABLE_NAMES_HGEN.keys())
df = pd.read_stata('../data/hgen.dta', columns=RETAINED_COLUMNS_HGEN)
df = df.rename(columns=VARIABLE_NAMES_HGEN)
df.sort_values(['ID_HH', 'YEAR'], axis=0, inplace=True)
df.loc[df.HH_NET_INCOME_MONTHLY < 0, 'HH_NET_INCOME_MONTHLY'] = np.nan
df.HH_NET_INCOME_MONTHLY.hist(range=(0, 25000), bins=100)
(df.HH_NET_INCOME_MONTHLY * 12).hist(range=(0, 50000), bins=100)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.15259259259259259, 'fraction_numerical': 0.03259259259259259, 'mean_word_length': 7.556962025316456, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '104249', 'license': 'BSD-3-Clause', 'n_tokens_mistral': 327, 'n_tokens_neox': 306, 'n_words': 41, 'path': 'src/exploration/explore_hgen.ipynb', 'repo_name': 'tobiasraabe/locus-of-control', 'size': '675'}