#Load and Display the Dataset
import pandas as pd
data = pd.read_csv('/content/Titanic-Dataset.csv')
data.head()
#View the shape, dimensions, and columns names
print("Shape:", data.shape)
print("Dimension:", data.ndim)
print("Column Names:", data.columns.tolist())
#Select first and second columns by the name
first_two = data[['PassengerId', 'Survived']]
first_two.head()
#Select first and third columns
first_third = data.iloc[:, [0, 2]]
first_third.head()
#Filter rows where age>30
filtered_data = data[data['Age'] > 30]
filtered_data.head()
#Filter data where Pclass and Survived ==1
filtered_data = data[(data['Pclass'] == 1) & (data['Survived'] == 1)]
filtered_data.head()
#Family Size
data['FamilySize'] = data['SibSp'] + data['Parch'] + 1
data.head()
# Increase Fare values by 1.10 and display
data['Fare'] = data['Fare'] * 1.10
data.head()
#Saved the modified Dataset
data.to_csv('/content/Titanic-Dataset.csv', index=False)
print("Modified dataset saved successfully.")
