Created in August 2024 PDF: paulgalea.com/Projects/Farmed_Land_Animals_Slaughtered/Visualisation.pdf /* ..................... */ /* ........TOOLS........ */ /* ..................... */ Python Adobe Illustrator /* ..................... */ /* ....PYTHON SCRIPT.... */ /* ..................... */ import pandas as pd import numpy as np human_population_df = pd.read_excel(r'DATA LOCATION', skiprows=16) # population.un.org/wpp/download/standard/mostused human_population_df = human_population_df[(human_population_df['Type'] == 'World')] human_population_df['Year'] = human_population_df['Year'].astype(int) human_population_df['Human Population'] = (human_population_df['Total Population, as of 1 July (thousands)']*1000).astype('int64') human_population_df = human_population_df[['Year','Human Population']] animal_df = pd.read_csv(r'DATA LOCATION', encoding='ISO-8859-1', low_memory=False) # fao.org/faostat/en/#data/qc animal_df = animal_df[(animal_df['Area'] == 'World') & (animal_df['Element'] == 'Producing Animals/Slaughtered') & (~animal_df['Item Code (CPC)'].str.contains('F')) & (animal_df['Item'].str.contains('meat', case=False))] columns = ['Item','Unit'] + animal_df.columns[animal_df.columns.get_loc('Unit')+1:].tolist() animal_df = pd.melt(animal_df[columns], id_vars=['Item','Unit'], var_name='Year', value_name='Land Animals Slaughtered') animal_df['Year'] = animal_df['Year'].str.replace(r'\D','', regex=True).astype(int) animal_df = animal_df[pd.to_numeric(animal_df['Land Animals Slaughtered'], errors='coerce').notna()] animal_df['Land Animals Slaughtered'] = pd.to_numeric(animal_df['Land Animals Slaughtered'], errors='coerce') animal_df['Land Animals Slaughtered'] = np.where(animal_df['Unit']=='1000 An', animal_df['Land Animals Slaughtered']*1000, animal_df['Land Animals Slaughtered']) animal_dfs, animals = {}, ['Asses','Bird','Buffalo','Camel','Cattle','Chicken','Duck','Game','Geese', 'Goat','Horse','Mule','Other meat','Pig ','Rabbit','Rodent','Sheep','Turkey'] for animal in animals: animal_dfs[animal] = animal_df[animal_df['Item'].str.contains(animal, case=False)].copy() animal_dfs[animal] = animal_dfs[animal].groupby(['Year'])['Land Animals Slaughtered'].sum().reset_index() animal_dfs[animal].rename(columns={'Land Animals Slaughtered': f"{animal} Slaughtered"}, inplace=True) animal_df = animal_dfs[animals[0]] for animal in animals[1:]: animal_df = pd.merge(animal_df, animal_dfs[animal], on=['Year'], how='outer') animal_df['Land Animals Slaughtered'] = animal_df.iloc[:, 1:].sum(axis=1) animal_df = animal_df.rename(columns={'Camel Slaughtered':'Camelid Slaughtered', 'Pig Slaughtered':'Pig Slaughtered'}) def seconds_in_year(year): if (year%4==0 and year%100!=0) or (year%400==0): return 366*24*60*60 else: return 365*24*60*60 df = animal_df.merge(human_population_df, on=['Year'], how='left') df['Land Animals Slaughtered per Second'] = df['Land Animals Slaughtered']/df['Year'].apply(seconds_in_year) df['Land Animals Slaughtered per Person'] = df['Land Animals Slaughtered'] / df['Human Population'] df.to_csv(r'DATA LOCATION') /* ..................... */ /* .......SOURCES....... */ /* ..................... */ Viewed online August 2024: Data: United Nations, Food and Agriculture Organisation (2023), 'Crops and Livestock Products', accessed August 2024: fao.org/faostat/en/#data/qc Data: United Nations, Department of Economic and Social Affairs (2024), 'World Population Prospects', accessed August 2024: population.un.org/wpp/download/standard/mostused 1. Mood, A., & Brooke, P. (2024), 'Estimating Global Numbers of Fishes Caught from the Wild Annually from 2000 to 2019': Cambridge University Press 2. Mood et al. (2023), 'Estimating Global Numbers of Farmed Fishes Killed for Food Annually from 1990 to 2019': Cambridge University Press 3. fishcount.org.uk/studydatascreens2/2017/numbers-of-farmed-decapods-A0-2017.php?sort2/full 4. fishcount.org.uk/studydatascreens2/2011/numbers-of-farmed-decapods-A0-2011.php?sort2/full