<commit_before>import pandas as pd
from astLib import astCoords
from numpy import round, isnan
import sys

def hms(ra):
    try:
        return astCoords.decimal2hms(ra, ':')
    except UnboundLocalError:
        return 'NaN'

def dms(dec):
    try:
        return astCoords.decimal2dms(dec, ':')
    except UnboundLocalError:
        return 'NaN'

def main(cluster):
    df = pd.read_csv('./../members/'+cluster+'_members.csv')
    df_part = df[['tile', 'dither', 'fiber', 'ra', 'dec', 'r', 'redshift',
        'Q', 'interloper', 'separation']]

    # remove the un-observed galaxies
    x = ~isnan(df_part['redshift'])
    df_part = df_part[x]

    # now we are going to round some of the columns to the right length
    df_part[['r']] = df_part[['r']].apply(round, args=(2,))
    df_part[['redshift']] = df_part[['redshift']].apply(round, args=(4,))
    df_part[['separation']] = df_part[['separation']].apply(round, args=(2,))

    # now we have to convert the ra/dec to sexigesimal
    df_part[['ra']] = [hms(ra) for ra in df_part[['ra']].values.ravel()]
    df_part[['dec']] = [dms(dec) for dec in df_part[['dec']].values.ravel()]

    # replace the interloper with checkmarks
    df_part.interloper[df_part.interloper == 'NO'] = r'surd'
    df_part.interloper[df_part.interloper == 'YES'] = r'...'<commit_msg>add latex command<commit_after>import pandas as pd
from astLib import astCoords
from numpy import round, isnan
import sys

def hms(ra):
    try:
        return astCoords.decimal2hms(ra, ':')
    except UnboundLocalError:
        return 'NaN'

def dms(dec):
    try:
        return astCoords.decimal2dms(dec, ':')
    except UnboundLocalError:
        return 'NaN'

def main(cluster):
    df = pd.read_csv('./../members/'+cluster+'_members.csv')
    df_part = df[['tile', 'dither', 'fiber', 'ra', 'dec', 'r', 'redshift',
        'Q', 'interloper', 'separation']]

    # remove the un-observed galaxies
    x = ~isnan(df_part['redshift'])
    df_part = df_part[x]

    # now we are going to round some of the columns to the right length
    df_part[['r']] = df_part[['r']].apply(round, args=(2,))
    df_part[['redshift']] = df_part[['redshift']].apply(round, args=(4,))
    df_part[['separation']] = df_part[['separation']].apply(round, args=(2,))

    # now we have to convert the ra/dec to sexigesimal
    df_part[['ra']] = [hms(ra) for ra in df_part[['ra']].values.ravel()]
    df_part[['dec']] = [dms(dec) for dec in df_part[['dec']].values.ravel()]

    # replace the interloper with checkmarks
    df_part.interloper[df_part.interloper == 'NO'] = r'\surd'
    df_part.interloper[df_part.interloper == 'YES'] = r'...'
{'fraction_non_alphanumeric': 0.1770951839211225, 'fraction_numerical': 0.0037921880925293893, 'mean_word_length': 3.710714285714286, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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}}
{'dir': 'git-commits-cleaned', 'id': '3742407', 'n_tokens_mistral': 978, 'n_tokens_neox': 959, 'n_words': 223}