import pandas as pd
import matplotlib.pyplot as plt
# Read the data from SAP SuccessFactors and Google Form/Microsoft Form
sap_data = pd.read_csv('sap_data.csv') # Replace 'sap_data.csv' with
the actual filename or path
form_data = pd.read_csv('form_data.csv') # Replace 'form_data.csv'
with the actual filename or path
# Merge the SAP SuccessFactors data with the form data based on
Employee ID/PersonID
merged_data = pd.merge(sap_data, form_data, on='Employee ID',
how='left')
# Aggregate the data to calculate headcount metrics
headcount_by_location = merged_data.groupby('Location')['Employee
ID'].count()
headcount_by_work_status = merged_data.groupby('Work Status')['Employee
ID'].count()
# Create the headcount dashboard visualizations
plt.figure(figsize=(10, 6))
# Plotting headcount by location
plt.subplot(1, 2, 1)
headcount_by_location.plot(kind='bar', color='blue')
plt.title('Headcount by Location')
plt.xlabel('Location')
plt.ylabel('Headcount')
# Plotting headcount by work status
plt.subplot(1, 2, 2)
headcount_by_work_status.plot(kind='pie', autopct='%1.1f%%', colors=
['green', 'orange', 'red'])
plt.title('Headcount by Work Status')
plt.legend(loc='best')
# Display the dashboard
plt.tight_layout()
plt.show()