# Write a Pandas program to create a Pivot table and find survival rate by gender.  
import pandas as pd
import numpy as np
df = pd.read_csv('titanic.csv')
result=df.groupby('sex')[['survived']].mean()
print(result)
