<jupyter_start><jupyter_text>Objective * feature engineer any data that can be used* preform eda* create visualizations that is relevent to the topic<jupyter_code># upload csv and call  as df
df = pd.read_csv("test_data_v4.csv")
print(df.shape)
def wrangle_fun(df):
    """
    Takes a dataframe and preforms eda and feature engineering 
    Returns wrangled dateframe
    """
    # create random sample of binary and change to male and female
    Sex = np.random.randint(2, size=46)  
    df["Sex"] = Sex
    df["Sex"] = df["Sex"].replace(0, "Male")
    df["Sex"] = df["Sex"].replace(1, "Female")

    # replacing white space with _ on column names
    df = df.rename(columns={"Case ID": "Case_Id", "Hearing Date": "Hearing_Date", "Type of Hearing": "Type_of_Hearing",
                    "Hearing Location": "Hearing_Location", "Decision Date": "Decision_Date", "Judge's Name": "Judge_Name",
                    "Protected Ground": "Protected_Ground", "If Social Group, Type": "Social_Group"
    })

    # drop Unnamed: 0 and int 0 column 
    df = df.drop(["Unnamed: 0", "0"], axis=1)

    return df


# preform wrangling on df 
df = wrangle_fun(df)<jupyter_output><empty_output><jupyter_text>* note: something that can be added on would be a judges start dateso the question you could ask is: does the judge's age effect outcome<jupyter_code>print(df.shape)
df.head()
df['Judge_Name'].value_counts()<jupyter_output><empty_output><jupyter_text>Questions I asked during eda that a graph can answer * Does any contries link to more cases of proteced grounds or social group * Does location link to outcomes * Does the hearing date effect outcomes    : lets say during 2020, did covid effect case outcome?  A stacked bar graph - Judge rulings divided into 2 bars by gender<jupyter_code>df_iris.head()
# example of stack graph to go off of 
df_iris = px.data.iris()
 
fig = px.bar(df_iris, x="sepal_width", y="sepal_length", color="species",
            hover_data=['petal_width'], barmode = 'stack')
 
fig.show()
df.head()
fig = px.bar(df, x="Judge_Name", y="Hearing_Date", color="Sex",
            hover_data=['Outcome'], barmode = 'stack')
 
fig.show()
df['Outcome']<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.12147406733393995, 'fraction_numerical': 0.007279344858962694, 'mean_word_length': 4.174117647058823, 'pattern_counts': {'":': 8, '<': 13, '<?xml version=': 0, '>': 13, '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': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '6410', 'license': 'MIT', 'n_tokens_mistral': 748, 'n_tokens_neox': 707, 'n_words': 230, 'path': 'visualizations/Labs32_visualization.ipynb', 'repo_name': 'rdukewiesenb/human-rights-first-asylum-ds-a', 'size': '2198'}