<jupyter_start><jupyter_text>Table of ContentsFundingInstructions / Notes:This dataset shows how much funding the state gave to individuals and tracks individuals' age, gender, and ethnicity.The dataset above shows how much funding (i.e., 'Expenditures' column) the state gave to individuals (for training purposes), including also individuals' age, gender, and ethnicity.Discrimination by EthnicityCluePandas supports grouping by multiple columns: https://stackoverflow.com/questions/17679089/pandas-dataframe-groupby-two-columns-and-get-counts Funding============= Instructions / Notes:**_Read these carefully_*** Read and execute each cell in order, without skipping forward* You **may** create new Jupyter notebook cells to use for e.g. testing, debugging, exploring, etc.- this is encouraged in fact!- **just make sure that your final answer dataframes and answers use the set variables outlined below*** _Have fun!_  This dataset shows how much funding the state gave to individuals and tracks individuals' age, gender, and ethnicity.<jupyter_code># Run the following to import necessary packages and import dataset
import pandas as pd
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
matplotlib.style.use('ggplot')
datafile = "dataset/funding.csv"
df = pd.read_csv(datafile)
df.drop('Dummy', axis=1, inplace=True)
df.head(n=5)   # Print n number of rows from top of dataset
ls = df['Age'].tolist()
df.describe(include='all')<jupyter_output><empty_output><jupyter_text>The dataset above shows how much funding (i.e., 'Expenditures' column) the state gave to individuals (for training purposes), including also individuals' age, gender, and ethnicity.<jupyter_code># Example dataframe query showing there is no discrimination by gender.
df.groupby(['Gender'], sort=True).agg({'Expenditures': [np.mean]})<jupyter_output><empty_output><jupyter_text>Discrimination by Ethnicity Analyze the data set and determine whether or not discrimination among **Hispanic** and **White but not Hispanic** groups exists by examining the ```Expenditures```. Feel free to use the dataframes defined in the cell below.<jupyter_code>w = "White not Hispanic"
h = "Hispanic"
is_hispanic = df['Ethnicity'] == h
is_white = df['Ethnicity'] == w
df1 = df[is_hispanic | is_white] # filters by two ethnicity groups
dfh = df[is_hispanic]
dfw = df[is_white]
df1.head(5)
df1.groupby(['Ethnicity', 'Age']).agg({'Expenditures': [np.mean]})
# Write your query below and set `df_answer' to the dataframe
df_answer = None
print(df_answer)<jupyter_output><empty_output><jupyter_text>After analyzing this dataset, was there discrimination in the expenditures across different ethnicities?<jupyter_code># Write answer below by setting discrimination to True or False
discrimination = None<jupyter_output><empty_output><jupyter_text>Clue Pandas supports grouping by multiple columns: https://stackoverflow.com/questions/17679089/pandas-dataframe-groupby-two-columns-and-get-countsIf this clue changes your answer, try again below. Otherwise, if you are confident in your answer above, leave the following untouched.<jupyter_code>df_answer_clue = None
print(df_answer_clue)
discrimination_clue = None<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.09583074051026758, 'fraction_numerical': 0.006845052893590542, 'mean_word_length': 6.546948356807512, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 21, 'https://': 2, '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': '160180', 'license': 'MIT', 'n_tokens_mistral': 954, 'n_tokens_neox': 904, 'n_words': 338, 'path': 'exam/data_cluedo/3-funding.ipynb', 'repo_name': 'gregunz/ada2017', 'size': '3214'}