I have a text file with this structure:
CRIM:Continuius
ZN:Continuius
INDUS:Continuius
CHAS:Categorical
NOX:Continuius
I inserted it into a two dimensional array:
BufferedReader description = new BufferedReader(new FileReader(fullpath2));
String[][] desc;
desc = new String[5][2];
String[] temp_desc;
String delims_desc = ":";
String[] tempString;
for (int k1 = 0; k1 < 5; k1++) {
String line1 = description.readLine();
temp_desc = line1.split(delims_desc);
desc[k1][0] = temp_desc[0];
desc[k1][1] = temp_desc[1];
}
and then tried to identify which attribute is Categorical:
String categ = "Categorical";
for (int i=0; i<5; i++){
String temp1 = String.valueOf(desc[i][1]);
if ("Categorical".equals(desc[i][1])){
System.out.println("The "+k1+ " th is categorical.");
}
}
Why doesn't it return true, although one of the attributes is categorical?
equalsIgnoreCaseor you don't have the input you think you doMap?