# Importance of variable to implement in Logistic Regression model in Python sklearn?

Logistic regression using Python sklearn

In Logistic Regression model we can implement variables which meet 3 conditions:

1. independent variables have to be correlated with dependent variable
2. independent variables have NOT to be correlated with each other
3. only relevant variables can be added to the model, otherwise it does not make sense

and both 1. and 2. point we can achieve using Pearson correlation for example:

-- correlation between independent variables and dependent variable (targetVariable

1. CORREL = data.corr().sort_values('TargetVariable')


--heatmap which shows lvl of Pearson correlation between independent variables (the closer 0 the lower the correlation)

2. sns.heatmap (data.corr(), cmap="coolwarm", annot=true)


But when I choose appropriate variables after 1. and 2. step how can I meet the 3. step and choose which variables (which are correlated with independent variable and not correlated with other independent variable) are important and I should use it in model and which are not important and I should out them? Maybe p-value and delete all with p-value higher than 0,05? But how?

Please give me the example code to meet 3. step.