Analyzing Sustainable Development Goal for Event Industry

The goal of this post is to analyze the #MakeoverMonday Week 38 dataset about Committments from the Event Industry for the Sustainable Development Goal. You can get the data from data.world. The process is to clean the dataset and analyzing dataset in Tableau. I hope you enjoy this.

In [1]:
# importing pandas and numpy package
import pandas as pd
import numpy as np

# creating the dataframe from the dataset
data = pd.read_excel('Positive Impact Events - Actions.xlsx')
In [2]:
data.head(2)
Out[2]:
Age Gender Education Level Disability City Country Goal Action Duration Job Role ActionID
0 41 male Beyond secondary None kuala lumpur, federal territory of kuala lumpu... malaysia 3 Do not use an event destination with high leve... 6 months Academic 31
1 41 male Beyond secondary None kuala lumpur, federal territory of kuala lumpu... malaysia 3 Provide education about national & global heal... Forever Academic 32
In [3]:
# creating bins for age range column
bins = [0, 15, 30, 45, 60, np.inf]
names = ['15 or Younger', '16 - 30', '31 - 45', '46 - 60', '61 and Above']
    
data['Age Group'] = pd.cut(data['Age'], bins, labels=names)
In [4]:
# formatting the strings
data['Gender'] = data['Gender'].str.capitalize()
data['Country'] = data['Country'].str.title()
data['Job Role'] = data['Job Role'].str.title()
data['Education Level'] = data['Education Level'].str.title()
data['Duration'] = data['Duration'].str.title()
data['City'] = data['City'].str.title()
data['Action'] = data['Action'].str.capitalize()
data['Disability'] = data['Disability'].str.title()
In [5]:
data.head(2)
Out[5]:
Age Gender Education Level Disability City Country Goal Action Duration Job Role ActionID Age Group
0 41 Male Beyond Secondary None Kuala Lumpur, Federal Territory Of Kuala Lumpu... Malaysia 3 Do not use an event destination with high leve... 6 Months Academic 31 31 - 45
1 41 Male Beyond Secondary None Kuala Lumpur, Federal Territory Of Kuala Lumpu... Malaysia 3 Provide education about national & global heal... Forever Academic 32 31 - 45
In [6]:
# spitting city column to derive only cities
data['Updated City'] = data['City'].str.split(',').str[0]
data.head(2)
Out[6]:
Age Gender Education Level Disability City Country Goal Action Duration Job Role ActionID Age Group Updated City
0 41 Male Beyond Secondary None Kuala Lumpur, Federal Territory Of Kuala Lumpu... Malaysia 3 Do not use an event destination with high leve... 6 Months Academic 31 31 - 45 Kuala Lumpur
1 41 Male Beyond Secondary None Kuala Lumpur, Federal Territory Of Kuala Lumpu... Malaysia 3 Provide education about national & global heal... Forever Academic 32 31 - 45 Kuala Lumpur
In [7]:
# creating goals dataframe to merge it with the data dataframe
goals_sheet = pd.read_excel('Positive Impact Events - Actions.xlsx', 'Goals', header=None, names=['Goal','Goal Name'])
goals_sheet.head(2)
Out[7]:
Goal Goal Name
0 1 NO POVERTY
1 2 ZERO HUNGER
In [8]:
# left join data with goals_sheet and formatting the column
final_df = pd.merge(data, goals_sheet, how='left', on='Goal')

final_df['Goal Name'] = final_df['Goal Name'].str.title()
final_df['Goal Name'] = final_df['Goal Name'].str.replace('And', '&')

final_df.head(2)
Out[8]:
Age Gender Education Level Disability City Country Goal Action Duration Job Role ActionID Age Group Updated City Goal Name
0 41 Male Beyond Secondary None Kuala Lumpur, Federal Territory Of Kuala Lumpu... Malaysia 3 Do not use an event destination with high leve... 6 Months Academic 31 31 - 45 Kuala Lumpur Good Health & Well-Being
1 41 Male Beyond Secondary None Kuala Lumpur, Federal Territory Of Kuala Lumpu... Malaysia 3 Provide education about national & global heal... Forever Academic 32 31 - 45 Kuala Lumpur Good Health & Well-Being
In [9]:
# exporting data to excel
final_df.to_excel('Positive Impact Events - Actions Updated.xlsx', index=0)

Author: Amandeep Saluja