Open AbdullahAssi opened 9 months ago
in the day 45 while doing groupby of 'Title and Survived' Error is occuring because of datatype.
Error can be solved by using this code.
`df['Survived'] = pd.to_numeric(df['Survived'], errors='coerce') # Convert to numeric, coerce errors to NaN
result = df.groupby('Title')['Survived'].mean().sort_values(ascending=False)
result.head()`
in the day 45 while doing groupby of 'Title and Survived' Error is occuring because of datatype.
Error can be solved by using this code.
`df['Survived'] = pd.to_numeric(df['Survived'], errors='coerce') # Convert to numeric, coerce errors to NaN
result = df.groupby('Title')['Survived'].mean().sort_values(ascending=False)
result.head()`