jtablesaw / tablesaw

Java dataframe and visualization library
https://jtablesaw.github.io/tablesaw/
Apache License 2.0
3.53k stars 641 forks source link

Table.compareRows not working as expected #1229

Open mohammedfaisal opened 1 year ago

mohammedfaisal commented 1 year ago

The static method Table.compareRows always returns false except for the last row. It happens even when we compare rows of the same table.

Table table = Table.read().csv(new File("data.csv"));
System.out.println(table.shape());

for(int i = 0; i < table.rowCount(); i++) {
    System.out.println("ROW " + i + ": "+ Table.compareRows(i, table, table));
}

Actual output:

data.csv: 5 rows X 2 cols
ROW 0: false
ROW 1: false
ROW 2: false
ROW 3: false
ROW 4: true

Expected output:

data.csv: 5 rows X 2 cols
ROW 0: true
ROW 1: true
ROW 2: true
ROW 3: true
ROW 4: true