Answers for "splitting Feature and target using iloc"

0

splitting Feature and target using iloc

# splitting features and the target variable
# consider all the columns except 'h1n1_vaccine' using 'iloc'
df_features = df_vaccine.iloc[:, df_vaccine.columns != 'h1n1_vaccine']

# consider the target variable
df_target = df_vaccine.iloc[:, df_vaccine.columns == 'h1n1_vaccine']
Posted by: Guest on April-04-2022

Python Answers by Framework

Browse Popular Code Answers by Language