<jupyter_start><jupyter_text>`ApJdataFrames` Erickson2011---`Title`: THE INITIAL MASS FUNCTION AND DISK FREQUENCY OF THE Rho OPHIUCHI CLOUD: AN EXTINCTION-LIMITED SAMPLE `Authors`: <NAME> al.Data is from this paper:  http://iopscience.iop.org/1538-3881/142/4/140/<jupyter_code>%pylab inline

import seaborn as sns
sns.set_context("notebook", font_scale=1.5)

#import warnings
#warnings.filterwarnings("ignore")
import pandas as pd<jupyter_output><empty_output><jupyter_text>Table 2- Optical Properties of Candidate Young Stellar Objects<jupyter_code>addr = "http://iopscience.iop.org/1538-3881/142/4/140/suppdata/aj403656t2_ascii.txt"
names = ['F', 'Ap', 'Alt_Names', 'X-Ray ID', 'RA', 'DEC', 'Li', 'EW_Ha', 'I', 'R-I',
       'SpT_Lit', 'Spectral_Type', 'Adopt', 'Notes', 'blank']
tbl2 = pd.read_csv(addr, sep='\t', skiprows=[0,1,2,3,4], skipfooter=7, engine='python', na_values=" ... ", 
                   index_col=False, names = names, usecols=range(len(names)-1))
tbl2.head()<jupyter_output><empty_output><jupyter_text>Table 3 - Association Members with Optical Spectra<jupyter_code>addr = "http://iopscience.iop.org/1538-3881/142/4/140/suppdata/aj403656t3_ascii.txt"
names = ['F', 'Ap', 'Alt_Names', 'WMR', 'Spectral_Type', 'A_v', 'M_I',
       'log_T_eff', 'log_L_bol', 'Mass', 'log_age', 'Criteria', 'Notes', 'blank']
tbl3 = pd.read_csv(addr, sep='\t', skiprows=[0,1,2,3,4], skipfooter=9, engine='python', na_values=" ... ", 
                   index_col=False, names = names, usecols=range(len(names)-1))
tbl3.head()
! mkdir ../data/Erickson2011<jupyter_output>mkdir: ../data/Erickson2011: File exists<jupyter_text>The code to merge the tables isn't working ```pythonon_F_ap = ["F", "Ap"]on_name = "Alt_Names"erickson2011 = pd.merge(tbl2, tbl3, on=on_F_ap, how="right")erickson2011 = pd.merge(tbl2, erickson2011, on="Alt_Names", how="right")message = "Table 2: {} entries \nTable 3: {} entries \nMerge: {} entries"print message.format(len(tbl2), len(tbl3), len(erickson2011))```<jupyter_code>plt.plot(10**tbl3.log_T_eff, 10**tbl3.log_L_bol, '.')
plt.yscale("log")
plt.xlim(5000, 2000)
plt.ylim(1.0E-4, 1.0E1)
plt.xlabel(r"$T_{eff}$")
plt.ylabel(r"$L/L_{sun}$")
plt.title("Erickson et al. 2011 Table 3 HR Diagram")<jupyter_output><empty_output><jupyter_text>Another thing to do would be to filter out the "Possible dwarfs", etc...  Save the data tables locally.<jupyter_code>tbl2.to_csv("../data/Erickson2011/tbl2.csv", sep="\t", index=False)
tbl3.to_csv("../data/Erickson2011/tbl3.csv", sep="\t", index=False)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.186347587289133, 'fraction_numerical': 0.06002353864260494, 'mean_word_length': 5.836461126005362, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 21, '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': '5', 'dir': 'jupyter-structured-clean-dedup', 'id': '511148', 'license': 'MIT', 'n_tokens_mistral': 1125, 'n_tokens_neox': 1008, 'n_words': 184, 'path': 'notebooks/Erickson2011.ipynb', 'repo_name': 'BrownDwarf/ApJdataFrames', 'size': '2554'}