[text] K

Viewer

  1. # Convert 'Extracurricular Activities' column to binary (0 or 1)
  2. df['Extracurricular Activities'] = df['Extracurricular Activities'].map({'Yes': 1, 'No': 0})
  3.  
  4. # Now, re-calculate the correlation matrix
  5. correlation_matrix = df.corr()
  6. dependent_variable_correlation = correlation_matrix['Performance Index']

Editor

You can edit this paste and save as new:


File Description
  • K
  • Paste Code
  • 27 Apr-2024
  • 310 Bytes
You can Share it: