Print columns of my dataset JAVA : <p>I have a dataframe which looks like this: </p>

<pre><code>id1 1 2 3 4  
id2 2 6 6 0 
id3 3 4 2 2
id4 4 3 3 1
id5 5 6 6 5
id6 6 2 4 6
</code></pre>

<p>The first line of the frame is the first data point. the second is another data point, etc...</p>

<p>my DataPoint Class is as follows:</p>

<pre><code>public class DataPoint {
    private ArrayList&lt;Integer&gt; values;
    private String id;
}
</code></pre>

<p>So for id1 the fields will be: id = id1, and values = {1, 2, 3, 4}, etc. 
What I'm trying to do is print the DataPoints by columns...</p>

<p>So for the above input, my output should be:</p>

<pre><code>1 2 3 4 5 6
2 6 4 3 6 2
3 6 2 3 6 4
4 0 2 1 5 6
</code></pre>

<p>I can't modify the above format of DataPoint because I'm too far ahead in my project and I can't afford to change all of the data structures :/ </p>

<p>Is there any way to transpose my results without changing the data structures?</p>
