I have dataframe with shape (335539, 26). So I have 26 features. But when i use
data.corr()
I get a 12 x 12 matrix.
What can be wrong? `
I have dataframe with shape (335539, 26). So I have 26 features. But when i use
data.corr()
I get a 12 x 12 matrix.
What can be wrong? `
Pearson co-relation can only be used with continuous data. There is no point of changing the categorical features to numerate between 1 to n for various reasons. You can change them to numerical using one hot encoding technique or dummy variables technique. It is not clear as to between what type of data features you are trying to find a co-relation. If you are trying to find co-relation between nominal variable and continuous variable, it is better called measure of association and you can calculate that using ANOVA which has built in implementation in scipy library. If its between ordinal variable and continuous variable you can use Spearman's co-relation method.
If still you want to find co-relation using corr() try converting your data with the above methods I mentioned, although I am not sure if you will get correct results.
Its better to first formulate your question properly and then look for the specific test which support your sample space.
corr() takes only numerical data and thus you only find the co-relation between your numerical features.