<jupyter_start><jupyter_text>`ApJdataFrames` Harvey 2010---`Title`: A SPITZER SEARCH FOR PLANETARY-MASS BROWN DWARFS WITH CIRCUMSTELLAR DISKS: CANDIDATE SELECTION  `Authors`: <NAME>, <NAME>, <NAME>, and <NAME>Data is from this paper:  http://iopscience.iop.org/0004-637X/720/2/1374/article<jupyter_code>%pylab inline
import seaborn as sns
import warnings
warnings.filterwarnings("ignore")
import pandas as pd<jupyter_output><empty_output><jupyter_text>Table 2 - Photometry of Selected Candidates<jupyter_code>names = ['Position','I','J','H','K_s','[3.6]','[4.5]','[5.8]','[8.0]','A_v','Luminosity']
link = 'http://iopscience.iop.org/0004-637X/720/2/1374/suppdata/apj363663t2_ascii.txt'
harvey2010_raw = pd.read_csv(link, sep='\t', names=names, skiprows=5, na_values=' sdotsdotsdot ')<jupyter_output><empty_output><jupyter_text>Data cleaning.<jupyter_code>harvey2010_raw.dropna(how='all', inplace=True)<jupyter_output><empty_output><jupyter_text>Split [value +or- error] into separate columns: [value], [error]<jupyter_code>fv = lambda a: a.split(' +or- ')[0] if a == a else np.NaN
fe = lambda a: a.split(' +or- ')[-1] if a == a else np.NaN #awesome little hack here!
bands = ['I','J','H','K_s','[3.6]','[4.5]','[5.8]','[8.0]']
harvey2010_tbl2 = harvey2010_raw.drop(bands, axis=1)
for band in bands:
    harvey2010_tbl2[band]=harvey2010_raw[band].apply(fv)
    harvey2010_tbl2[band+'_e']=harvey2010_raw[band].apply(fe)<jupyter_output><empty_output><jupyter_text>Split the position into RA and DEC.<jupyter_code>harvey2010_tbl2.insert(0, 'RA', harvey2010_tbl2.Position.str.slice(0, 11).copy())
harvey2010_tbl2.insert(1, 'DEC', harvey2010_tbl2.Position.str.slice(12).copy())
harvey2010_tbl2.drop('Position', axis=1, inplace=True)<jupyter_output><empty_output><jupyter_text>Save data locally !!mkdir ../data/Harvey2010<jupyter_code>harvey2010_tbl2.to_csv('../data/Harvey2010/tbl2.csv')<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.18053375196232338, 'fraction_numerical': 0.07535321821036106, 'mean_word_length': 7.976525821596244, 'pattern_counts': {'":': 0, '<': 29, '<?xml version=': 0, '>': 29, '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': '6', 'dir': 'jupyter-structured-clean-dedup', 'id': '199430', 'license': 'MIT', 'n_tokens_mistral': 860, 'n_tokens_neox': 762, 'n_words': 119, 'path': 'notebooks/Harvey2010.ipynb', 'repo_name': 'BrownDwarf/ApJdataFrames', 'size': '1945'}