import pandas as pd
# Read data from Excel into a DataFrame
file_path = "data.xlsx"
df = pd.read_excel(file_path)
# Print the DataFrame
print("Original DataFrame:")
print(df)
# Perform simple operations on the DataFrame
# Add a new column 'Bonus' which is 10% of the 'Salary'
df['Bonus'] = df['Salary'] * 0.1
# Print the DataFrame after adding the 'Bonus' column
print("\nDataFrame after adding the 'Bonus' column:")
print(df)
# Calculate the average age
average_age = df['Age'].mean()
print("\nAverage Age:", average_age)
# Find the person with the highest salary
highest_salary_person = df.loc[df['Salary'].idxmax(), 'Name']
print("\nPerson with the highest salary:", highest_salary_person)
# Filter the DataFrame to include only people with a salary greater than 35000
filtered_df = df[df['Salary'] > 35000]
print("\nFiltered DataFrame:")
print(filtered_df)